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
Array.prototype.shuffle = function () { | |
var i, j, tempi, tempj; | |
i = this.length; | |
if ( i === 0 ) { | |
return false; | |
} | |
while ( --i ) { | |
j = Math.floor( Math.random() * ( i + 1 ) ); | |
tempi = this[i]; |
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 fs = require('fs'), | |
sys = require('sys'), | |
http = require('http'); | |
http.createServer(function (req, res) { | |
checkBalanceFile(req, res); | |
}).listen(8000); | |
function checkBalanceFile(req, res) { | |
fs.stat("balance", function(err) { |
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 | |
PARALLEL_CONNECTS = 10, | |
http = require('http'), | |
sys = require('sys'), | |
connectionCount = 0, | |
messageCount = 0; | |
lastMessages = 0; | |
function addClient() { |
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 Client(config) { | |
if (!(this instanceof Client)) { | |
return new Client(config); | |
} | |
} |
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
/*! | |
* jQuery Tiny Pub/Sub - v0.X - 11/18/2010 | |
* http://benalman.com/ | |
* | |
* Original Copyright (c) 2010 "Cowboy" Ben Alman | |
* Dual licensed under the MIT and GPL licenses. | |
* http://benalman.com/about/license/ | |
* | |
* Made awesome by Rick Waldron | |
* |
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
ex. | |
git checkout origin master | |
git pull origin master | |
--create branch and track master | |
git checkout -b f1-1234 origin/master | |
--make changes | |
--resolve conflicts, DO NOT PUSH branch, the merge is just to resolve conflicts |
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 find(root, obj) { | |
var seen = []; | |
function search(root, name, depth) { | |
if (root === obj) { | |
console.log(name); | |
return; | |
} | |
if (!depth) { return; } | |
if (seen.indexOf(root) >= 0) { return; } | |
if (typeof root !== "object") { return; } |
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
module.exports = require('http').createServer(require('stack')( | |
require('creationix/log')(), | |
require('creationix/static')('/', __dirname, "index.html") | |
)) |
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
/** | |
* Shamelessly stolen from http://blog.jeansebtr.com/post/36590722386/async-loading-of-githubs-gists-without-jquery-31-loc | |
* | |
* Use like this: <gist data-username="brandonb927" data-id="4138162" data-file="gists2.js"><a href="https://gist.github.com/brandonb927/4138162#file_gists2.js">Gist</a></gist> | |
* UPDATED 02/06/2013: Github implemented Namespaced Gists a few hours ago, which means gist.github.com/4149074 now redirects to gist.github.com/brandonb927/4149074 and I have updated the gist to reflect this new format | |
* | |
*/ | |
(function(){ | |
var gists = document.getElementsByTagName('gist'); |
OlderNewer