Skip to content

Instantly share code, notes, and snippets.

View gimdongwoo's full-sized avatar

Dongwoo Gim gimdongwoo

View GitHub Profile
@gimdongwoo
gimdongwoo / webpack.config.js
Last active January 21, 2019 13:58
AWS Lambda
'use strict';
const path = require('path');
const webpack = require('webpack');
const config = {
devtool: 'source-map',
entry: './src/index.ts',
output: {
path: path.resolve('./target'),
filename: 'index.js',
// This is javascript code.
const pluckDeep = key => obj => key.split('.').reduce((accum, key) => accum[key], obj)
const compose = (...fns) => res => fns.reduce((accum, next) => next(accum), res)
// Yeah!
const unfold = (f, seed) => {
const go = (f, seed, acc) => {
const res = f(seed)
return res ? go(f, res[1], acc.concat([res[0]])) : acc
// This is javascript code.
const pluckDeep = key => obj => key.split('.').reduce((accum, key) => accum[key], obj)
const compose = (...fns) => res => fns.reduce((accum, next) => next(accum), res)
const unfold = (f, seed) => {
const go = (f, seed, acc) => {
const res = f(seed)
return res ? go(f, res[1], acc.concat([res[0]])) : acc
}
// This is javascript code.
const pluckDeep = key => obj => key.split('.').reduce((accum, key) => accum[key], obj)
const compose = (...fns) => res => fns.reduce((accum, next) => next(accum), res)
const unfold = (f, seed) => {
const go = (f, seed, acc) => {
const res = f(seed)
return res ? go(f, res[1], acc.concat([res[0]])) : acc
}
// This is javascript code.
const pluckDeep = key => obj => key.split('.').reduce((accum, key) => accum[key], obj)
const compose = (...fns) => res => fns.reduce((accum, next) => next(accum), res)
const unfold = (f, seed) => {
const go = (f, seed, acc) => {
const res = f(seed)
return res ? go(f, res[1], acc.concat([res[0]])) : acc
}
// This is javascript code.
const pluckDeep = key => obj => key.split('.').reduce((accum, key) => accum[key], obj)
const compose = (...fns) => res => fns.reduce((accum, next) => next(accum), res)
const unfold = (f, seed) => {
const go = (f, seed, acc) => {
const res = f(seed)
return res ? go(f, res[1], acc.concat([res[0]])) : acc
}
@gimdongwoo
gimdongwoo / sms.js
Created September 28, 2016 12:44
Titanium Android SMS Send for listView clicked node
var Q = require("q");
var selectedModels = [];
// 리스크 클릭시 선택 처리
$.listView.addEventListener('itemclick', function(e){
var item = $.section.getItemAt(e.itemIndex);
var itemId = e.itemId;
var clickModel = notFriendContactsCol.get(itemId);
if (_.findWhere(selectedModels, clickModel)) {
item.checkIcon.image = '/images/friendlist_edit_un_checkbox.png';
@gimdongwoo
gimdongwoo / stdDeviation.js
Last active June 10, 2016 08:48
Standard Deviation & Standard Score @javascript
// https://gist.github.com/matthutchinson/1648603
// http://jsfiddle.net/hiddenloop/TPeJt/
var array = [2, 3, 4, 6, 2, 5, 7, 2, 4, 5];
var within_std_of = 1;
outputResult = function(str) {
console.log(str);
}
@gimdongwoo
gimdongwoo / sendSMS.js
Last active May 25, 2016 08:32
Titanium Send SMS feature using native module ( https://github.com/omorandi )
// Special thanks to omorandi.
// Android : https://github.com/omorandi/TiAndroidSMS
// iOS : https://github.com/omorandi/TiSMSDialog
// need q.js https://github.com/kriskowal/q
var Q = require("q");
function makeSMSrecivers() {
//
// make smsReceivers
@gimdongwoo
gimdongwoo / CloudCode.js
Last active July 12, 2020 14:48
Background Job in Parse Server (node/cron)
// src/CloudCode.js
"use strict"
var Cron = require('./Cron');
var Job = require('./Job');
class CloudCode {
constructor(Parse, timezone){
this.Parse = Parse;