Skip to content

Instantly share code, notes, and snippets.

View sangwonl's full-sized avatar

gamz sangwonl

View GitHub Profile
import { useCallback, useEffect, useRef, useState } from 'react';
function debounce(callback: Function, delay = 300) {
let handle: number;
return function () {
if (handle) clearTimeout(handle);
handle = setTimeout(callback, delay);
};
}
@sangwonl
sangwonl / airflow_python_xcom_sample.py
Created August 2, 2018 13:45
airflow_python_xcom_sample.py
"""
Code that goes along with the Airflow located at:
http://airflow.readthedocs.org/en/latest/tutorial.html
"""
from airflow import DAG
from airflow.operators.python_operator import PythonOperator
from datetime import datetime, timedelta
import logging
[marathon] [chronos] [spark] [kubernetes]
container distributed & distributed job container
orchestration fault-tolerant | orchestration
| scheduler | |
| | | |
+---------------------+---------------+--------------------+
|
dc/os <------ mesosphere (company version)
|
apache mesos
# This code snippet is based on python 3.
from datetime import datetime
from urllib.request import Request, urlopen
from urllib.parse import urlencode
from urllib.error import HTTPError
from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
from email.mime.application import MIMEApplication
#-*- coding: utf-8 -*-
import unittest
DAY_OF_WEEK = ['월', '화', '수', '목', '금', '토', '일']
DOW_INDEX_DISTANCE_TBL = {
# 1st element: base index ex) 0: 월, 1: 화, ...
# 2nd element: distance ex) 수-월=2, 목-월=3
(0, 0): '월',
(1, 0): '화',
@sangwonl
sangwonl / keybase.md
Last active September 19, 2017 04:47

Keybase proof

I hereby claim:

  • I am sangwonl on github.
  • I am sangwonl (https://keybase.io/sangwonl) on keybase.
  • I have a public key ASBN2BQO5q7-Abfn_QpmIl6YXOGJRCy1trLLUEj4mBgHpAo

To claim this, I am signing this object:

var DashButton = require("node-dash-button");
var hue = require("node-hue-api");
var GoogleSpreadsheet = require('google-spreadsheet');
var creds = require('./client_secret.json');
var dateFormat = require('dateformat');
var HueApi = hue.HueApi;
var lightState = hue.lightState;
var DashButton = require("node-dash-button");
var hue = require("node-hue-api");
var HueApi = hue.HueApi;
var lightState = hue.lightState;
var hostname = "172.31.2.12";
var username = "dWAksDC1ms0uTSIVlgsD3XbyP4KLodto7o31L7X";
var api = new HueApi(hostname, username);
var state = lightState.create();
var dash = DashButton("88:71:e3:88:28:69", null, null, 'all');
dash.on("detected", function (){
var DashButton = require("node-dash-button");
var dash = DashButton("88:71:e3:88:28:69", null, null, 'all');
dash.on("detected", function () {
console.log("my aws button is clicked!!");
});