Skip to content

Instantly share code, notes, and snippets.

@chulman444
chulman444 / daily-request-reply.py
Created May 26, 2021 18:42
대신 cybos Request 예제 (DsCbo1.StockWeek Request)
import win32com.client, signal
from PyQt5.QtWidgets import *
from PyQt5.QAxContainer import *
from PyQt5.QtCore import *
from src.qtpy_base import QtPy
class CpEvent:
def set_params(self, inst):
@chulman444
chulman444 / index.js
Last active June 25, 2020 11:14
Express app redirect http to https.
/**
* Install express and create a directory `sslcert/`
*
* > npm i express
* > mkdir sslcert
*
* Create https key and cert
*
* > openssl req -nodes -new -x509 -keyout sslcert/server.key -out sslcert/server.cert
* > # Just Enter through the prompts
@chulman444
chulman444 / google-sheet-script-iterate-selection.js
Created October 16, 2019 17:02
Google sheet script for iterating over range list of a selection
function iterateSelection() {
var selection = SpreadsheetApp.getSelection()
var rangeList = selection.getActiveRangeList()
var ranges = rangeList.getRanges()
var count = 0
var anchor_pos = [10, 1]
SpreadsheetApp.getActiveSheet().getRange(anchor_pos[0] - 1, anchor_pos[1]).setValue(ranges.length)
for(var i = 0; i < ranges.length; i++) {
SpreadsheetApp.getActiveSheet().getRange(anchor_pos[0] + i, anchor_pos[1]).setValue(ranges[i].getA1Notation())
@chulman444
chulman444 / vue-simple-reactivity-demo.vue
Last active August 3, 2019 07:21
Simple reactivity demo. Adding new property
<template lang="pug">
div
div {{ entry.foo.hi }}
v-btn(@click="onBtnClick") click
</template>
<script lang="ts">
import { Vue, Component } from "nuxt-property-decorator"
@Component
@chulman444
chulman444 / pagination-pattern.ts
Created July 27, 2019 13:39
Pagination using Axios. The property names you see here are YouTube api prop names such as `nextPageToken` and `items`.
function main() {
const axios_config:any = {
params: {
// some_params that will later accept pagination related params
},
url: "some url"
}
let all_entries:any[] = []
let response_data:any
@chulman444
chulman444 / index.js
Created March 10, 2019 23:47
Proxy with express and axios
const axios = require('axios')
const proxy = require("express-http-proxy")
const appFactory = () => require("express")()
const PORT = [
[3010, factoryFirst],
[3011, factorySecond],
[3012, factoryThird]
]
@chulman444
chulman444 / App.vue
Created October 31, 2018 04:06
Vue.js. Toggle components.
<template>
<div id="app">
<button type="button" v-on:click="onButtonClick">Toggle</button>
<div ref="comp-container" class="comp-container">
<div ref="container" class="container">
</div>
</div>
</div>
</template>
@chulman444
chulman444 / async-await.js
Last active September 21, 2018 06:40
I prefer async and await.
const myRequest = new Request(window.location.origin + "/test");
async function callRequest() {
res_p = await fetch(myRequest);
res_text = await res_p.text();
return res_text
}
callRequest().then(val => {
console.log(val);
});
@chulman444
chulman444 / README.md
Created September 21, 2018 04:53
See your webcam on the browser and take a screenshot of the webcam
@chulman444
chulman444 / README.md
Last active September 20, 2018 00:39
Upload to node server file