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 buffer = require('vinyl-buffer'); | |
var source = require('vinyl-source-stream'); | |
var browserify = require('browserify'); | |
var uglify = require('gulp-uglify'); | |
gulp.task('index', function(){ | |
var bundler = browserify('newstimeline/livescript/index.ls'); | |
bundler.transform('browserify-livescript'); | |
return bundler.bundle({insertGlobals: true}) |
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 Timer = React.createClass({ | |
displayName: 'Timer', | |
propTypes: { | |
interval: React.PropTypes.number, | |
onTick: React.PropTypes.func | |
}, | |
getDefaultProps: function() { | |
return { | |
interval: 1000 | |
}; |
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 last = Date.now(); | |
var lag = 0; | |
setInterval(function(){ | |
lag = Date.now() - last; | |
last = Date.now(); | |
}, 0); |
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 os = require('os'); | |
const fs = require('fs'); | |
const path = require('path'); | |
const execFile = require('child_process').execFile; | |
const tmpfile = path.join(os.tmpdir(), process.versions.v8+'.flags.json'); | |
const exclusions = ['--help']; | |
module.exports = function (cb) { | |
fs.exists(tmpfile, function (exists) { |
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
#!/bin/bash | |
# SCSS include path | |
BINPATH=`dirname $0` | |
STATIC_DIR="$BINPATH/../root/static/scss" | |
# SCSS | |
function compile_dir { | |
SCSS_DIR=$1 | |
SCSS=scss |
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
// | |
// 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}, |
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
//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 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 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 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 |