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
map = (obj, cb) -> | |
out = {} | |
todo = Object.keys(obj).length | |
check = -> cb out if --todo is 0 | |
for key, val of obj | |
if typeof val is 'function' | |
do (key) -> | |
t = val (res) -> | |
out[key] = res |
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
@['__bind'] = (fn, scope) -> | |
nu = -> | |
fn.apply scope, arguments | |
(nu._scope?=[]).push scope | |
return nu |
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
makeUUID = -> | |
"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace /[xy]/g, (a, b) -> | |
b = Math.random() * 16 | |
return (if a is "y" then b & 3 | 8 else b | 0).toString 16 |
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
### | |
http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating | |
requestAnimationFrame polyfill by Erik Möller | |
fixes from Paul Irish and Tino Zijdel | |
Coffeescript and AMD by Blaine Bublitz | |
### |
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
//This function initializes the library | |
exports.initialize = function (wha) { | |
console.log("initialized " + wha); | |
}; | |
//This is super complex - watch out for it! | |
//Serious bro | |
exports.coolprop = "hi"; | |
//This function kills a process |
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
// | |
// Create main view | |
// | |
A2B.createView = function() { | |
// create map view | |
A2B.mapview = Titanium.Map.createView({ | |
mapType: Titanium.Map.STANDARD_TYPE, | |
animate:true, | |
regionFit:true, | |
region:{latitude:33.74511, longitude:-84.38993, latitudeDelta:0.5, longitudeDelta:0.5}, |
NewerOlder