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
| // see http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
| // shim layer with setTimeout fallback | |
| window.requestAnimFrame = (function(){ | |
| return window.requestAnimationFrame || | |
| window.webkitRequestAnimationFrame || | |
| window.mozRequestAnimationFrame || | |
| window.oRequestAnimationFrame || | |
| window.msRequestAnimationFrame || |
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
| # Quick hack of regular expressions to convert twitter bootstrap from LESS to Stylus | |
| less2stylus = (string) -> | |
| string = string | |
| .replace(/^(\ *)(.+)\ +\{\ *\n?\ */mg, "$1$2\n$1 ") # remove opening brackets | |
| .replace(/^(\ *)([^\ ]+)\ +\{\ *\n?\ *?/mg, "$1$2\n$1 ") # remove opening brackets | |
| .replace(/\ *\{\ *\n*/g, "\n") # remove opening brackets again (some random cases I'm too lazy to think through) | |
| .replace(/\ *\}\ *\n*/g, "\n") # remove closing brackets | |
| .replace(/\;\ *?$/gm, "") # remove semicolons | |
| .replace(/@([\w]+)[\s\t]*:(\ *)\ /g, "$$$1$2 = ") # replace @variable: with $variable = | |
| .replace(/\@(?!import|media|font\-face|keyframes|extend)/g, "\$") |
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
| // Run Redis - cd redis-2.2.4 and run src/redis-server | |
| var sip = require('sip'); | |
| var sys = require('sys'); | |
| var redis = require('redis'); | |
| var tropoapi = require('tropo-webapi'); | |
| //Trim leading and trailing whitespace from string values. | |
| function trim(str) { | |
| return str.replace(/^\s+|\s+$/g, ''); |
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
| // Run Redis - cd redis-2.2.4 and run src/redis-server | |
| var sip = require('sip'); | |
| var sys = require('sys'); | |
| var redis = require('redis'); | |
| var tropoapi = require('tropo-webapi'); | |
| //Trim leading and trailing whitespace from string values. | |
| function trim(str) { | |
| return str.replace(/^\s+|\s+$/g, ''); |