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 raceCondition(fn) { | |
var counter = 0; | |
return function() { | |
var index = ++counter; | |
var prom = fn.apply(this, arguments); | |
return new Promise(function(resolve, reject) { | |
prom.then(function(value) { | |
if (isLast()) resolve(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
env: | |
browser: true | |
globals: | |
define: true | |
rules: | |
# possible errors | |
comma-dangle: [1, "always-multiline"] | |
no-cond-assign: [2, "except-parens"] |
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() { | |
'use strict'; | |
if (window.Map) return; | |
window.Map = FakeMap; | |
function FakeMap() { | |
this._keys = []; | |
this._values = []; | |
} |
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
angular.module('my-module') | |
.directive('mqAllowExternalClone', function($compile) { | |
return { | |
link: link, | |
}; | |
function link(scope, elem, attr) { | |
var element = elem[0]; | |
var original = element.cloneNode; | |
element.cloneNode = patch; |
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
// usage | |
withAdvice.call(targetObject); | |
var withSomething = function() { | |
this.wrap('walk', function() { | |
// before | |
this.base(); | |
// after | |
}); | |
}; |
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 press(key) { | |
document.getElementById("hplogo").onkeydown({ | |
keyCode:key, | |
preventDefault:function() { } | |
}); | |
} | |
var interval; | |
document.addEventListener('keydown', function(e) { | |
if (e.keyCode !== 96) |
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
/** | |
* Provides: | |
* Function extend(Function parent, Object config); | |
* | |
* It extends constructors with it's methods | |
* Also provides to every method who overwrites another one | |
* with a this.base() method to invoke overwrote method. | |
* | |
* Created constructor has methods | |
* .extend(Object config) |
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
/* eslint no-multi-spaces:0 */ | |
(function(root) { | |
var Firebase = root.Firebase; | |
var toArray = Function.prototype.call.bind(Array.prototype.slice); | |
window.FirebasePromise = FirebasePromise; | |
function DisconnectWrapper(disconnect) { | |
this._ref = disconnect; | |
} |
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
Babel | |
Base16 color schemes | |
Cucumber | |
GitSavvy | |
Grunt | |
Gulp | |
Javsacript Beautify | |
JavascriptNext - ES6 Syntax | |
jsFormat | |
LESS |
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 extensions() { | |
function arr(val) { | |
return Array.prototype.slice.call(val); | |
} | |
function extend(Type, prototype) { | |
function E(val) { this.val = val } | |
E.prototype = prototype; | |
prototype.constructor = E; |