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
/* jshint browser: true, devel: true */ | |
/** | |
* preg_replace (from PHP) in JavaScript! | |
* | |
* This is basically a pattern replace. You can use a regex pattern to search and | |
* another for the replace. For more information see the PHP docs on the original | |
* function (http://php.net/manual/en/function.preg-replace.php), and for more on | |
* JavaScript flavour regex visit http://www.regular-expressions.info/javascript.html | |
* |
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
// easing functions http://goo.gl/5HLl8 | |
Math.easeInOutQuad = function (t, b, c, d) { | |
t /= d/2; | |
if (t < 1) { | |
return c/2*t*t + b | |
} | |
t--; | |
return -c/2 * (t*(t-2) - 1) + b; | |
}; |
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 spawn = require('child_process').spawn | |
var instance = { | |
ipAddress: "0.0.0.0" | |
}; | |
var awsPreSharedKeyPath = '~/.ssh/aws-preshared-key.pem'; // make sure key has permissions 600 with chmod | |
var spawnArgs = [ '-tt', // force teletype since ssh uses a psuedo-terminal |
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 s = new Signal(), cb = function(a, b){ console.log('callback', arguments, this); }; | |
s.add(cb); | |
s.add(cb); | |
s.dispatch('for', 'science', '!', 1); | |
s.remove(cb); | |
s.dispatch('for', 'science', '!', 2); | |
s.remove(cb); | |
s.dispatch('for', 'science', '!', 3); |
NewerOlder