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
console.clear(); | |
const loop = (arrayOfPromises, guard) => { | |
if (arrayOfPromises.length && (!guard || guard(arrayOfPromises[0]))) { | |
return arrayOfPromises.shift()().then(() => { | |
return loop(arrayOfPromises, guard); | |
}) | |
} | |
return Promise.resolve(); |
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
const unWrapMobxInjectedComponent = <T extends {}>(component: IWrappedComponent<T>): T => { | |
let last: any = component; | |
while (component.wrappedComponent) { | |
last = component.wrappedComponent; | |
} | |
return last as T; | |
} |
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
lsof -i tcp:{{port}} | |
// find PID from list | |
kill -9 {{PID}} |
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
// Primitive example of creating a helper library to describe elements | |
var m = require('mithril'); | |
var materialElements = ['textfield']; | |
var mt = function(selector, options, children) { | |
if (selector === 'textfield') { | |
return m('div.mdl-textfield.mdl-js-textfield.mdl-textfield--floating-label', [ | |
m('input.mdl-textfield__input', { | |
id: options.id, |
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
// Primitive example of creating a helper library to describe elements | |
var m = require('mithril'); | |
var materialElements = ['textfield']; | |
var mt = function(selector, options, children) { | |
if (selector === 'textfield') { | |
return m('div.mdl-textfield.mdl-js-textfield.mdl-textfield--floating-label', [ | |
m('input.mdl-textfield__input', { | |
id: options.id, |
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
// Crockford Shim | |
if (typeof Object.create !== "function") { | |
Object.create = function(superClassFunction) { | |
function subClassFunction() {} | |
subClassFunction.prototype = superClassFunction; | |
return new subClassFunction(); | |
}; | |
} |
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
var data = [ | |
["UK", 1000], | |
["UK", 100], | |
["UK", 10], | |
["FR", 2000], | |
["FR", 200], | |
["FR", 20], | |
["GE", 3000], | |
["GE", 300], | |
["GE", 30] |
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($,throttledResizeEvent){ | |
var throttle = function (func, wait) { | |
var context, | |
args, | |
result, | |
timeout, | |
previous; | |
wait = wait || 1000 / 60; |
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
var GothicArchFactory = function() { | |
var _60degrees = 1.04719755, // radians for Math trig functions | |
_30degrees = 0.523598776, | |
_createArch = function(archWidth, archHeight) { | |
// this private method creates and returns the arch... | |
// the arch knows it's dimensions and can draw itself on | |
// a canvas | |
return { | |
archWidth : archWidth, | |
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
[merge] | |
tool = webstorm | |
[diff] | |
tool = webstorm | |
[difftool "webstorm"] | |
cmd = webstorm diff $(cd $(dirname "$LOCAL") && pwd)/$(basename "$LOCAL") $(cd $(dirname "$REMOTE") && pwd)/$(basename "$REMOTE") | |
trustExitCode = false | |
[mergetool "webstorm"] | |
cmd = webstorm merge $(cd $(dirname "$LOCAL") && pwd)/$(basename "$LOCAL") $(cd $(dirname "$REMOTE") && pwd)/$(basename "$REMOTE") $(cd $(dirname "$BASE") && pwd)/$(basename "$BASE") $(cd $(dirname "$MERGED") && pwd)/$(basename "$MERGED") | |
trustExitCode = false |
NewerOlder