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 (window) { | |
// This library re-implements setTimeout, setInterval, clearTimeout, clearInterval for iOS6. | |
// iOS6 suffers from a bug that kills timers that are created while a page is scrolling. | |
// This library fixes that problem by recreating timers after scrolling finishes (with interval correction). | |
// This code is free to use by anyone (MIT, blabla). | |
// Original Author: rkorving@wizcorp.jp | |
var timeouts = {}; | |
var intervals = {}; | |
var orgSetTimeout = window.setTimeout; | |
var orgSetInterval = window.setInterval; |
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://eslint.org/docs/rules/ | |
"env": { | |
"browser": true, // browser global variables. | |
"node": false, // Node.js global variables and Node.js-specific rules. | |
"worker": false, // web workers global variables. | |
"amd": false, // defines require() and define() as global variables as per the amd spec. | |
"mocha": false, // adds all of the Mocha testing global variables. | |
"jasmine": false, // adds all of the Jasmine testing global variables for version 1.3 and 2.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
function delay(expressionAsFunction) { | |
var result; | |
var isEvaluated = false; | |
return function () { | |
if (!isEvaluated) | |
result = expressionAsFunction(); | |
return result; | |
}; | |
} |
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
db = db.getSisterDB("config"); | |
var mongosConn = db; // assume we connected to a mongos to get going | |
var res = null; | |
function check() { | |
printjson(res); | |
if( !res || !res.ok ) { | |
throw "check(): not ok, stopping"; |
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
fractalModule =function(stdlib){ | |
"use asm"; | |
var pow = stdlib.Math.pow; | |
var abs = stdlib.Math.abs; | |
var atan2 = stdlib.Math.atan2; | |
var cos = stdlib.Math.cos; | |
var sin = stdlib.Math.sin; | |
function mandlebrot(cx, cy, maxIter) { | |
cx = +cx; | |
cy = +cy; |
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
% ab -n 10 -c 10 -p json.file -T "application/json; charset=utf-8" http://localhost/ |
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
<div id="consolelog" style="font-family: 'Courier New', Courier, monospace; font-size: 12px; margin: 40px 30px 0px; background-color: white; border: 2px solid black; padding: 10px;"></div> | |
<input type="text" id="consoleinput" style="margin: 0px 30px; width: 400px;" onkeypress="return evalConsoleInput(event, this.value);" /> | |
<script type="text/javascript"> | |
var appendConsole = function(message, type) { | |
var color = "black"; | |
if (type === "error") { | |
color = "red"; | |
} else if (type === "debug") { |
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
// common.js ====================================== | |
(function(exports) { | |
// Define all your functions on the exports object | |
exports.foo = function() { | |
return 'bar'; | |
}; | |
})((typeof process === 'undefined' || !process.versions) |
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 S4() { | |
return (((1+Math.random())*0x10000)|0).toString(16).substring(1); | |
} | |
function guid() { | |
return (S4()+S4()+"-"+S4()+"-"+S4()+"-"+S4()+"-"+S4()+S4()+S4()); | |
} |
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
# Based on https://github.com/kripken/emscripten/wiki/Tutorial | |
# prerequisites | |
cd ~/ | |
brew install node | |
sudo ln -s /usr/bin/python2.7 /usr/bin/python2 | |
curl http://llvm.org/releases/3.2/clang+llvm-3.2-x86_64-apple-darwin11.tar.gz > llvm.tgz | |
tar xzvf llvm.tgz | |
ln -s clang+llvm-3.2-x86_64-apple-darwin11 llvm |