This file contains hidden or 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 getAdder(a) { | |
return function(b) { | |
return a + b; | |
}; | |
} | |
// Another way to write the same is this: | |
// const getAdder = a => b => a + b; | |
const addOne = getAdder(1); |
This file contains hidden or 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 reparse = require('../actions/reparse'); | |
module.exports = function mapDispatchToPropsPlusReparse(fn) { | |
return function(dispatch, ownProps) { | |
function reparse() { | |
return dispatch(reparse(true)); | |
} | |
return Object.assign({reparse: reparse}, fn ? fn(dispatch, ownProps) : {}); | |
}; | |
}; |
This file contains hidden or 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 chainOptions(props, fn) { | |
function getWrapper(options = {}) { | |
const wrapper = (...args) => fn(options, ...args); | |
props.forEach(prop => { | |
Object.defineProperty(wrapper, prop, { | |
enumerable: true, | |
get() { | |
return getWrapper(Object.assign({}, options, {[prop]: !options[prop]})); | |
}, | |
set() {}, |
This file contains hidden or 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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or 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 noTrailingComma = { | |
example: 123, | |
test: 456, | |
sweet: 'thing', | |
yay: 'omg', | |
newthing: true | |
}; | |
var trailingComma = { | |
example: 123, |
This file contains hidden or 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
// Inspired by the eslint-plugin-react wrap-multilines rule | |
// https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/wrap-multilines.md | |
// | |
// I don't know why, but this is making me really happy right now. | |
// Instead of this | |
var someName = namespace.someObj.method1({ | |
prop: 'value', | |
}).method2('foo', 'bar'); |
This file contains hidden or 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
Pizzicato Five - Happy End Of The Band (BS Fuji Studio Last Sessions) - 01 Intro.mp4 | |
Pizzicato Five - Happy End Of The Band (BS Fuji Studio Last Sessions) - 02 The Night Is Still Young.mp4 | |
Pizzicato Five - Happy End Of The Band (BS Fuji Studio Last Sessions) - 03 A New Song.mp4 | |
Pizzicato Five - Happy End Of The Band (BS Fuji Studio Last Sessions) - 04 Serial Stories.mp4 | |
Pizzicato Five - Happy End Of The Band (BS Fuji Studio Last Sessions) - 05 Triste.mp4 | |
Pizzicato Five - Happy End Of The Band (BS Fuji Studio Last Sessions) - 06 Sweet Soul Revue.mp4 | |
Pizzicato Five - Happy End Of The Band (BS Fuji Studio Last Sessions) - 07 To Our Children’s Children’s Children.mp4 | |
Pizzicato Five - Happy End Of The Band (BS Fuji Studio Last Sessions) - 08 Ma Vie, L’ete De Vie.mp4 | |
Pizzicato Five - Happy End Of The Band (BS Fuji Studio Last Sessions) - 09 Drinking Wine.mp4 | |
Pizzicato Five - Happy End Of The Band (BS Fuji Studio Last Sessions) - 10 Goodbye Baby & Amen.mp4 |
This file contains hidden or 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.prototype.doesMyAsyncAbstractionWork = function() { | |
var fn = this; | |
var args = arguments; | |
setTimeout(function() { | |
fn.apply(null, args); | |
}, Math.random() * 5000); | |
}; |
This file contains hidden or 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 util = require("util"); | |
function Thing() { | |
// The instance is also a proxy function for its __default method. | |
var instance = function() { | |
return instance.__default.apply(instance, arguments); | |
}; | |
// The instance needs to inherit from Thing.prototype. | |
instance.__proto__ = Thing.prototype; | |
// Initialize the instance with the __ctor method. |
This file contains hidden or 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
#!/usr/bin/env ruby | |
require 'net/http' | |
# get id | |
user = IO.popen("whoami", "r+").gets.chomp | |
program = ARGV[0].to_s | |
idfile = "/Users/#{user}/Library/Gyazo/id" | |
old_idfile = File.dirname(program) + "/gyazo.app/Contents/Resources/id" |