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
| (function(expose) { | |
| var foo = 'bar'; | |
| // expose | |
| expose(foo); | |
| })(function(name, export) { | |
| if ('object' == typeof module && module.exports) module.exports = export; | |
| else if ('function' == typeof define && define.amd) define(name, [], function() { return export; }); | |
| else if ('object' == typeof window) window[name] = export; |
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
| void usleep(DWORD waitTime){ | |
| LARGE_INTEGER perfCnt, start, now; | |
| QueryPerformanceFrequency(&perfCnt); | |
| QueryPerformanceCounter(&start); | |
| do { | |
| QueryPerformanceCounter((LARGE_INTEGER*) &now); | |
| } while ((now.QuadPart - start.QuadPart) / float(perfCnt.QuadPart) * 1000 * 1000 < waitTime); | |
| } |
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
| $ui-sprites: sprite-map('ui/*.png'); | |
| $ui-2x-sprites: sprite-map('ui-2x/*.png'); | |
| @mixin ui($item) { | |
| -moz-box-sizing: content-box; | |
| -webkit-box-sizing: content-box; | |
| box-sizing: content-box; | |
| background-image: sprite-url($ui-sprites); | |
| background-position: sprite-position($ui-sprites, $item); |
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
| /** | |
| * Load scripts in parallel keeping execution order. | |
| * @param {array} An array of script urls. They will parsed in the order of the array. | |
| * @returns {$.Deferred} | |
| */ | |
| function getScripts(scripts) { | |
| var xhrs = scripts.map(function(url) { | |
| return $.ajax({ | |
| url: url, | |
| dataType: 'text', |
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
| { | |
| "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
| 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
| 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 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 |