View and edit it on http://ngryman.sh/obelisk-buildr/#10070311.
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
/** | |
* Heartbeat rhythm | |
*/ | |
var heart = document.querySelector('footer span') | |
var heartBounds = heart.getBoundingClientRect() | |
var rhythm | |
document.body.addEventListener('mousemove', function(e) { | |
var mx = e.clientX | |
var my = e.clientY |
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 PassThrough = require('stream').PassThrough | |
, util = require('util') | |
, spawn = require('child_process').spawn | |
, os = require('os'); | |
function Transcoder() { | |
PassThrough.call(this); | |
this.on('pipe', function(inStream) { | |
// inStream.unpipe(this) |
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
// warm up | |
fn() | |
fn() | |
// try to optimize | |
;%OptimizeFunctionOnNextCall(compare) | |
// call optimized | |
fn() |
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
[deoptimize global object @ 0x30ea29d106e9] | |
--- FUNCTION SOURCE (optCompare) id{0,0} --- | |
(a, b) { | |
return a['foo'] === b['foo'] | |
} | |
--- END --- | |
--- FUNCTION SOURCE (deoptCompare) id{1,0} --- | |
(a, b) { | |
var prop = 'foo' |
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 browserify = require('browserify') | |
, gulp = require('gulp') | |
, gutil = require('gulp-util') | |
, mocha = require('gulp-mocha') | |
, source = require('vinyl-source-stream') | |
, watchify = require('watchify'); | |
var b = watchify(browserify({ | |
entries: ['./app/index.js'], | |
debug: true |
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 waterfall(tasks, callback) { | |
var firstTask = tasks.shift(); | |
return tasks.reduce(function(prevPromise, task) { | |
return prevPromise.then(function() { | |
var args = Array.prototype.slice.call(arguments); | |
args.unshift(task); | |
return makePromise.apply(null, args); | |
}); | |
}, makePromise(firstTask)); |
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 withoutDiatrics = function() { | |
var diatrics = 'ÀÁÂÃÄÅàáâãäåÒÓÔÕÕÖØòóôõöøÈÉÊËèéêëðÇçÐÌÍÎÏìíîïÙÚÛÜùúûüÑñŠšŸÿýŽž'; | |
var stripped = 'AAAAAAaaaaaaOOOOOOOooooooEEEEeeeeeCcDIIIIiiiiUUUUuuuuNnSsYyyZz'; | |
return function(str) { | |
var len = str.length, out = ''; | |
for (var i = 0; i < len; i++) { | |
var index = diatrics.indexOf(str[i]); | |
out += (-1 != index ? stripped[index] : str[i]); |
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
{ | |
"name": "grabber", | |
"version": "0.0.0", | |
"description": "Jeremy se lance dans le bis", | |
"main": "grabber.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1" | |
}, | |
"author": "", | |
"license": "ISC", |
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 |