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
### | |
# An implementation of the msgpack serialization format - http://msgpack.org/ | |
# By Devon Govett | |
# MIT LICENCE | |
### | |
class MsgPack | |
idx = 0 | |
@pack: (data, byteArray = false) -> |
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
// I use this to reconstitute the values returned by HGETALL ( http://redis.io/commands/hgetall ). | |
function rehash (values) { | |
var hash = {} | |
, isKey = true | |
, key; | |
if (!Array.isArray(values)) return hash; | |
values.forEach(function(value) { | |
if (isKey) { | |
key = value; |
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
// http://twitter.com/#!/littlecalculist/status/89848378682392576 | |
// http://twitter.com/#!/littlecalculist/status/89855977838485504 | |
// Unary Array.from() | |
Array.from = function( arrayish ) { | |
return [].slice.call( arrayish ); | |
}; |
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
/* | |
A console.log that won't leave you hanging when node exits | |
*/ | |
console.log = function(d) { | |
var res = process.stdout.write(d + '\n'); | |
// this is the first time stdout got backed up | |
if (!res && !process.stdout.pendingWrite) { | |
process.stdout.pendingWrite = true; |
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
machine github.com | |
login technoweenie | |
password SECRET | |
machine api.github.com | |
login technoweenie | |
password SECRET |
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
// we're all so 1337 by @gregarious | |
$('.avatar_laptop img').attr('src','https://s3.amazonaws.com/static.turntable.fm/roommanager_assets/props/laptop_linux.png'); |
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
function define(name, fn) { | |
if (!defs) { defs = {}; } | |
defs[name] = fn; | |
} | |
function require(name) { | |
console.log("Loading " + name); | |
if (modules && modules.hasOwnProperty(name)) return modules[name]; | |
if (defs && defs.hasOwnProperty(name)) { | |
if (!modules) { modules = {}; } | |
var fn = defs[name]; |
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
// ==UserScript== | |
// @name Turntable Growler | |
// @namespace http://fluidapp.com | |
// @description Creates growl notifications for chat in turntable | |
// @include * | |
// @author Gregarious Narain | |
// ==/UserScript== | |
(function () { | |
if (window.fluid) { |
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
var express = require('express'); | |
var redis = require('redis'); | |
const serverType = process.argv[2]; | |
const serverHost = process.argv[3]; | |
const serverPort = parseInt(process.argv[4]); | |
const redisPort = 6379; | |
const redisHost = '127.0.0.1'; |
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
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
. ~/.bashrc | |
mkdir ~/local | |
mkdir ~/node-latest-install | |
cd ~/node-latest-install | |
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
./configure --prefix=~/local | |
make install # ok, fine, this step probably takes more than 30 seconds... | |
curl http://npmjs.org/install.sh | sh |