This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
brew cask | |
brew cask install docker-toolbox | |
docker-machine create --driver "virtualbox" myBoxName | |
docker-machine start myBoxName | |
# copy to .bash_profile or .zshrc to be executed everytime | |
eval "$(docker-machine env myBoxName)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fetch = require( 'node-fetch' ) // skip if in Chrome Latest version | |
const hnItemUrlBase = 'https://hacker-news.firebaseio.com/v0/item/' // HN Url Base | |
const hnItemId = 14561637 // real itemId | |
// hacker news required format | |
const makeItemUrl = ( prefix, itemId ) => `${prefix}${itemId}.json` | |
// fetch Wrapper | |
const fetchWrapper = ( prefix, itemId ) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
@input: Input array to be flattened | |
@result: Empty Array | |
@return: | |
invalid input: Empty Array | |
valid input (an Array): Flattened Array | |
*/ | |
function flatten(input, result) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"v":1, | |
"t":[{ | |
"t":7, | |
"e":"form", | |
"f":[{ | |
"t":7, | |
"e":"label", | |
"f":["Without Focus Handler"] | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define(function(require){ | |
return "success"; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[5, 45, 53,2, 43,21].reduce((max, current) => maax > current ? max : current, -Infinity); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var oboe = require('oboe') | |
fs = require('fs') | |
path = require('path') | |
mkdirp = require('mkdirp') | |
mv = require('mv') | |
rootDir = path.join(__dirname, 'dist') | |
apps = [] // temp store for all apps found in a | |
urls = {} // temp store for all urls found in a config file | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function str2hex(str){ | |
var arr = []; | |
str.split('').forEach(function(c){ | |
arr.push(c.charCodeAt()); | |
}); | |
return arr; | |
} | |
function hexarr2str(arr){ |