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 Routes = (function() { | |
var _ = {}, ctor = function(){}; | |
_.bind = function bind(func, context) { | |
var bound, args, slice = Array.prototype.slice; | |
args = slice.call(arguments, 2); | |
return bound = function() { | |
if (!(this instanceof bound)) return func.apply(context, args.concat(slice.call(arguments))); | |
ctor.prototype = func.prototype; | |
var self = new ctor; | |
var result = func.apply(self, args.concat(slice.call(arguments))); |
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
function renderElement(page, selector) { | |
var prevClipRect = page.clipRect; | |
page.clipRect = page.evaluate(function(selector) { | |
return document.querySelector(selector).getBoundingClientRect(); | |
}, selector); | |
var pic = page.renderBase64('png'); | |
page.clipRect = prevClipRect; |
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 separator = ','; | |
} | |
start | |
= comma | |
comma | |
= & { return separator = ','; } sv:sv { return sv; } |
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
/* | |
Relies on jQuery, underscore.js, Async.js (https://github.com/caolan/async), and zip.js (http://gildas-lormeau.github.com/zip.js). | |
Tested only in Chrome on OS X. | |
Call xlsxParser.parse(file) where file is an instance of File. For example (untested): | |
document.ondrop = function(e) { | |
var file = e.dataTransfer.files[0]; | |
excelParser.parse(file).then(function(data) { | |
console.log(data); |
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
doc.addPage | |
size: 'legal' | |
layout: 'landscape' |
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
Show hidden characters
[ | |
{ | |
"args": | |
{ | |
"characters": "\"" | |
}, | |
"command": "insert" | |
}, | |
{ | |
"args": null, |
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
<?php | |
require 'PHP-Parser/lib/bootstrap.php'; | |
ini_set('memory_limit', '512M'); | |
// Feeds the given file to the PHP parser to be parsed and analyzed | |
function analyze_file($path, $parser, $traverser, $visitor) { | |
$code = file_get_contents($path); | |
$visitor->setFile($path); | |
$stmts = $parser->parse($code); | |
$stmts = $traverser->traverse($stmts); |
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
// Each of these takes just a few milliseconds | |
app.get('/js/main.js', browserify('./public/js/main.js', { | |
external: ['three'], | |
detectGlobals: false | |
})); | |
app.get('/js/three.js', browserify(['three'], { | |
noParse: ['three'], // doesn't parse to look for global vars OR calls to require; just includes as-is | |
cache: true, // instructs browser to cache, even in dev, because this won't be changing |
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
/** | |
* @author James Baicoianu / http://www.baicoianu.com/ | |
* Originally from http://threejs.org/examples/js/controls/FlyControls.js | |
* Simplified to only obey gamepad | |
*/ | |
THREE.FlyControls = function(object) { | |
this.object = object; | |
// API |
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 | |
# Usage: git-reset-to-date date repo1 repo2 ... | |
# Example: git-reset-to-date "7/14/2013 14:00" repo1 repo2 repo3 | |
require_clean_work_tree () { | |
# Update the index | |
git update-index -q --ignore-submodules --refresh | |
err=0 |
OlderNewer