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
#!/bin/bash | |
# | |
# Install UI tools | |
# - node | |
# - jshint | |
# - csslint | |
# - phantomjs | |
# - casperjs | |
# - specter |
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
ARCDIR = /usr/local/share/arcanist | |
BINPATH = /usr/bin/arc | |
PHPPATH = /usr/bin/php | |
help: | |
@echo "no target specified." | |
@echo "try:" | |
@echo " make [ install | update | config_linters ]" | |
@echo "" |
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
#!/bin/bash | |
# | |
# uisetup | |
# | |
# This script will install the basic tools and utilities used | |
# on the UI team, and then it will kick off another script to | |
# install the shared development stack used by all developers | |
# create ~/bin if not already exists |
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 fmtWholeNum (num) { | |
var n = parseFloat(num.toString().replace(/[^\d\.]+/, '')), | |
s = Math.floor(n).toString(); | |
return s.replace(/(\d)(?=(\d\d\d)+(?!\d))/g, "$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
/** | |
* Returns TRUE if all arguments passed in can be evaluated as true. | |
* Otherwise, returns FALSE. | |
*/ | |
function all() { | |
var i, l = arguments.length; | |
for (i = 0; i < l; i++) { | |
if (!arguments[i]) { | |
return false; | |
} |
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
if (Object.defineProperty) { | |
Object.defineProperty(Object.prototype, 'doYouEven', { | |
value: function(key) { | |
var props = (key || '').split('.'), | |
item = this; | |
for (var i=0; i<props.length; i++) { | |
item = item[props[i]]; | |
if (typeof item === 'undefined') return false; | |
} | |
return 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
var Rangemap = function(points, values) { | |
this.points = points || []; | |
this.values = values || []; | |
}; | |
Rangemap.prototype = { | |
"equalInRange": true, | |
"compare": function(a, b) { | |
if (a === b) { | |
return this.equalInRange; |
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 Color(r, g, b) { | |
if (Array.isArray(r)) { | |
colors = r; | |
} else if (!g && !b) { | |
colors = this.asRGB(r); | |
} else { | |
colors = [r, g, b]; | |
} | |
this.r = colors[0]; | |
this.g = colors[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
// language exceptions | |
var exceptions = { | |
"are": "were", | |
"eat": "ate", | |
"go": "went", | |
"have": "had", | |
"inherit": "inherited", | |
"is": "was", | |
"run": "ran", | |
"sit": "sat", |
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 yo(fn) { | |
if (fn instanceof Function) { | |
this.listeners.push(fn); | |
} else { | |
_.each(this.listeners, function (listener) { | |
listener(fn); | |
}) | |
} | |
} |