Skip to content

Instantly share code, notes, and snippets.

@rorcraft
rorcraft / gist:11407295
Created April 29, 2014 17:48
node module structure
// 1. bind every function
function foo(locale) {
return locale + '-foo';
}
module.exports = function helper(locale) {
return {
foo: foo.bind(null, locale)
}
@rorcraft
rorcraft / .slate
Created June 26, 2014 18:19
Slate config
# This is the default .slate file.
# If no ~/.slate file exists this is the file that will be used.
config defaultToCurrentScreen true
config nudgePercentOf screenSize
config resizePercentOf screenSize
# Resize Bindings
bind right:alt;ctrl resize +10% +0
bind left:alt;ctrl resize -10% +0
@rorcraft
rorcraft / gist:4156de0301a326d7d497
Last active January 18, 2016 22:42
Lodash notes.

Lodash

  1. _() vs _.chain()
> _([1,2,3,4,5]).map(function (x) { return x * x }).first(3).value()
[ 1, 4, 9 ] // the same if first(3)
> _.chain([1,2,3,4,5]).map(function (x) { return x * x }).first(3).value()
[ 1, 4, 9 ] // the same if first(3)
> _.chain([1,2,3,4,5]).map(function (x) { return x * x }).first()