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
<html> | |
<head> | |
<script> | |
var beacon = (function() { | |
function fireBeacon(url, cb) { | |
//debug('Firing beacon ' + url); | |
var beacon = new Image(); | |
beacon.onload = function() { | |
cb(); | |
}; |
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 request = require('request').defaults({ jar: true }); | |
var config = require('./config.json'); | |
var log = console.log.bind(console); | |
function wrapcb(orig_url, cb) { | |
return function(err, res, body) { | |
if (res && res.statusCode === 302) { | |
var url = require('url').resolve(orig_url, res.headers.location); | |
log('Redirect from ' + orig_url + ' to ' + url); |
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
/* ~/Library/KeyBindings/DefaultKeyBinding.Dict | |
This file remaps the key bindings of a single user on Mac OS X 10.5 to more closely | |
match default behavior on Windows systems. | |
You must log out and back in to see these changes. | |
Here is a rough cheatsheet for syntax. | |
Key Modifiers | |
^ : Ctrl | |
$ : Shift |
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 domain = require('domain'); | |
var assert = require('assert'); | |
var DELAY = 10; | |
function doerr() { | |
var fired = false; | |
setTimeout(function () { | |
fired = 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
[ | |
// Rebind mac to be like windows | |
{ "keys": ["ctrl+n"], "command": "new_file" }, | |
{ "keys": ["ctrl+s"], "command": "save" }, | |
{ "keys": ["ctrl+shift+s"], "command": "prompt_save_as" }, | |
{ "keys": ["ctrl+alt+s"], "command": "save_all" }, | |
{ "keys": ["ctrl+f4"], "command": "close" }, |
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 tick() { | |
//error('test'); | |
var z = getParam('ground_height'); | |
var pos = getPos(); | |
if (pos[2] < z) { | |
setGravity({ gravity: [0, 0, min(5, z - pos[2])] }); | |
} else { | |
setGravity({ gravity: [0, 0, -9.8] }); | |
} | |
} |
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 assert = require('assert'); | |
var zlib = require('zlib'); | |
var gzip = zlib.createGzip(); | |
var fs = require('fs'); | |
var FILENAME = 'log.txt.gz'; | |
var out = fs.createWriteStream(FILENAME); | |
gzip.pipe(out); | |
function debug(msg) { |
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 http = require('http'); | |
http.createServer(function (req, res) { | |
res.writeHead(200, {'Content-Type': 'text/plain'}); | |
var count=0; | |
function doit() { | |
while (res.writable && res.write('Data!\r\n\r\n')) { | |
++count; | |
if (count % 1000 === 0) { | |
console.log('wrote ' + count + ' chunks'); | |
return process.nextTick(doit); |
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 dns = require('dns'); | |
var http = require('http'); | |
var https = require('https'); | |
var blocked = ['207.171.163.193']; | |
var user_supplied_hostname = 'www.cloudpartytime.com'; | |
dns.lookup(user_supplied_hostname, function(err, address) { | |
console.log('DNS lookup returned ' + address); |
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 assert = require('assert'); | |
var http = require('http'); | |
var agent = new http.Agent({maxSockets: 1}); | |
var headers = {'connection': 'keep-alive'}; | |
var PORT = 8080; | |
var responses = 0; | |
var errors = 0; |