Skip to content

Instantly share code, notes, and snippets.

View woosungchu's full-sized avatar

woosungchu woosungchu

View GitHub Profile
@woosungchu
woosungchu / quiz1.py
Last active August 4, 2022 14:16
Do you think you know recursive function and asyncio?
import asyncio
import time
def recur(depth):
depth -= 1
print('recursion in', depth)
for ea in [1,2,3,4,5]:
if depth>0:
recur(depth)
@woosungchu
woosungchu / common_health_bar
Last active July 3, 2021 03:05
weakaura for wsc
!WA:2!9EzxSXXvvCCVAuuOdIiBNgtSRtRtiF5ksQZ6ettPbxV2RZ6e7DDgV2oj20DNzN7UZeVEMj3zw)fFeIjnyO8PBakIIuyBQaHYdrRqO(csO8g80rwWlGaKYBeNNIq8apq5CUZSF5piPOcJK9oZDVZ9EU3))o)p3n0en7Q09Xp1X7Q5zBwVz9v23AAQzMrNB70VDEB(5KKKgvQRJFQhOzZ1z8ibFPtJrYBU0sQC9osABN3Z0PONDM5yCxtBR9gk1FxXnJAEMKM)RzWxmr2SUmVy)MxV3)51(Gp4Fvs1kJHnFuBtlpT(JgpzuLI(9DmZLy7OK)9(XqOqHK4lemaVw7nC7gWRWfm1lPY6o2PzzM)ONxHRMXdNB3EuC9u5EYrmTm9K1YIF4AiVSh3mxom8A7W8GBVzrDMwHSztUOdJhl6WJo44dhXdFqrTaxn8YUoS85hs3v(bUf0yZXS8gd7T5cLs1FFJLm1yj7tjzKc4KO5KxDrgVs3gLZWUPm2OrhEyfrlAXyQ59muSuNL5kVAbRGqqoyjhvphZPPXUAbvoRJblKpFhtAy6XEmU3W4wQ5NWFFDQICwo8tkIvYXTl4SQllFwXEiiFatDNgF0BFN1FZ7K6rL(LRF73B97DR1ul4HBZjCe7nYLYYXqympUQNQ0J9LGbPMOHuBS(vIgnEK82Q6dgXfLHwuMTaQTYrW9ImTaHLvYKx11LUtZdLxlpXTzSTYAMt(((lgFD6zkIBhkIWfxXQwMZQsHqpqtdc7nILTf7(mvxkuyw58m25A64Mo1JuKeWDz4GQ7Um1hk2GxjYSQMw47cVc8z3j8QWzGphE7U3ylfP3Zmy1AAL1M7pXYbe1qwyWj1CMRSsxfDDu5ZmPPUNXEUV4E)q)IHGpri4JfcEgqEnr7k2EIbjKtt198i26Si9nEYeqJ4ctgAwg2Tm8SXpmSNvA6bfCzPu1CT5Au)sdVa0XQuBI9W0qlWNeJ99vKAYqWhgWZbTVgU6ZG7S(nf(eD1fSF4aWjvgqz8Hg
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title></title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tone/14.7.12/Tone.js"></script>
<script type="text/javascript">
//create a synth and connect it to the master output (your speakers)
const synth = new Tone.Synth().toMaster();
@woosungchu
woosungchu / newFunction.js
Created December 4, 2017 08:46
newFunction.js
// https://jsfiddle.net/woosungchu/krs21ac2/
function createEmployeeObject3(firstName, lastName, gender, designation){
var employee={};
employee.firstName=firstName;
employee.lastName=lastName;
employee.gender=gender;
employee.designation=designation;
return employee;
}
@woosungchu
woosungchu / worldClock.js
Created November 24, 2017 02:11
WorldClock in Javascript
document.write('KST (한국 표준시):<br />', getWorldTime(+9), '<br /><br />');
document.write('PST (태평양 표준시):<br />', getWorldTime(-8), '<br /><br />');
document.write('PDT (태평양 표준시 DST):<br />', getWorldTime(-7), '<br /><br />');
document.write('EST (뉴욕 시간):<br />', getWorldTime(-5), '<br /><br />');
document.write('EDT (뉴욕 시간 DST):<br />', getWorldTime(-4), '<br /><br />');
document.write('CET (파리 시간):<br />', getWorldTime(+1), '<br /><br />');
document.write('CEST (파리 시간 DST):<br />', getWorldTime(+2), '<br /><br />');
@woosungchu
woosungchu / example.js
Created November 20, 2017 07:20
Apply vs. Call vs. Bind Examples
/*
https://stackoverflow.com/questions/15455009/javascript-call-apply-vs-bind
*/
function call(){
var person1 = {firstName: 'Jon', lastName: 'Kuperman'};
var person2 = {firstName: 'Kelly', lastName: 'King'};
function say(greeting) {
var nBizfileLoader;
(function($) {
$(document).ready(function(){
var getUploadOption = function(files){
var result = {
max_file_size : "100mb" ,
addedCallback :checkFileOn,
@woosungchu
woosungchu / payLaterHistoryInfo.sql
Created November 2, 2017 04:11
payLaterHistoryInfo.sql
# U = USE , R = REFUND, amount = eachPrice
select
ifnull(sum(a.sms),0) as smsSize
,ifnull(sum(a.lms),0) as lmsSize
,ifnull(sum(a.mms),0) as mmsSize
,ifnull(sum(a.amount),0) as totalPrice
from (
select
case when message_type = 'SMS' then ( case when gubun = 'U' then 1 else -1 end) else 0 end as sms
function dfs(depth, x, y){
if(depth == 5)return false;
var div = document.createElement('div');
div.style.position = 'absolute';
div.style.left = (x + 100)+'px';
div.style.top = (y + 100)+'px';
div.style.width = (depth * 10)+'px';
div.style.height = (depth * 10)+'px';
div.style.padding = '10px';
div.style.background = '#eee';
@woosungchu
woosungchu / JavaFetcher.java
Last active October 11, 2017 15:04
JavaFetcher.java
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.net.HttpURLConnection;
import java.net.URL;
import javax.net.ssl.HttpsURLConnection;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;