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
## Project in ./project (with its classic packages.json and subfolders node_modules etc.) non-git | |
# The simpler solution would be to | |
# - create a remote repo on github.com | |
# - clone it | |
# - add your files into | |
# - commit/push | |
# | |
# clone inject already all the necessary config to work |
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
Show hidden characters
[ | |
{ "keys": ["f2"], "command": "side_bar_move" }, // f2 just to rename the selected 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
{ | |
"env": { | |
"browser": true, | |
"node": true | |
}, | |
"parser": "babel-eslint", | |
"plugins": [ | |
"eslint-plugin-react" | |
], | |
"rules": { |
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 nodes = [{ | |
name: 'A', | |
nodes: [{ | |
name: 'x' | |
}] | |
}, { | |
name: 'B', | |
expanded: true, | |
nodes: [{ | |
name: 'x', |
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 echo = (msg, delay = 50) => new Promise((resolve) => setTimeout(() => resolve(msg), delay)); | |
const echoUpperCase = (msg, delay = 50) => new Promise((resolve) => setTimeout(() => resolve(new Date().toISOString() + ' ' + msg.toUpperCase()), delay)); | |
const foreachAsync = async (array, cb) => { for (let i = 0, l = array.length; i < l; i++) await cb(array[i]);}; | |
const severalDelays = async (...msgs) => { | |
//msgs; // BABEL HACK https://github.com/babel/babel/issues/1882 | |
// var ret = ''; | |
// we can't use forEach because the await is inside another method. | |
// so we have to async the function | |
// but if it's async, we need to await it |
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
// context based, functional? :-( | |
function foo() { | |
const format = (name) => name.toUpperCase(); | |
const mapper = (item) => format(item); | |
['foo', 'bar'].map(mapper); | |
} | |
// no context based, functional! :-) | |
function bar() { | |
const format = (name) => name.toUpperCase(); |
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 reduceReducers(...reducers) { | |
return (initialState, action) => | |
reducers.reduce((state, mutator) => mutator(state, action), initialState); | |
} | |
const metaReducer = reduceReducers( | |
(state, action) => ({ name: state.name, value: state.value + 1 }), | |
(state, action) => ({ name: state.name.toUpperCase(), value: state.value }) | |
); |
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
::-webkit-scrollbar-track { | |
background-color: rgba(113,112,107,0.2); | |
} | |
::-webkit-scrollbar { | |
width: 10px; | |
height: 10px; | |
} |
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
# To start: docker run -e HUBOT_SLACK_TOKEN=xxx_from_slack_integration_tool_xxx hubot | |
# another image could be used. It seems to not be up to date with alpine? | |
FROM mhart/alpine-node | |
RUN npm i -g coffee-script | |
RUN npm i -g yo generator-hubot | |
# can't yo as root, let's create a user | |
RUN adduser -h /hubot -D hubot | |
USER hubot |
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 requestAnimationFrameOnce(fn) { | |
var requested = false; | |
return function(lastState) { | |
if (!requested) { | |
requested = true; | |
requestAnimationFrame(function() { | |
fn(lastState); | |
requested = false; | |
}); | |
} |
OlderNewer