Skip to content

Instantly share code, notes, and snippets.


Keybase proof

I hereby claim:

  • I am wadey on github.
  • I am wadey ( on keybase.
  • I have a public key whose fingerprint is 6B06 FA83 D482 D52A E59E C5F8 0B42 F7A3 E3D9 D6D7

To claim this, I am signing this object:

import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
wadey /
Last active Aug 29, 2015
World Cup Slack Bot (with delay for no spoilers)
import time
import json
from twitter import TwitterStream, OAuth
import requests
import settings
twitter_stream = TwitterStream(
View godeps.zsh
typeset -A DONE
_dep() {
go list -f "{{if not .Standard}}{{printf \"\t%q -> %q;\n\" \"$1\" .ImportPath}}{{end}}" "$2"
_graph() {
if [ -z ${DONE[$1]} ]
wadey / index.html
Created Dec 3, 2010
SimpleGeo Advanced getLocation Example
View index.html
<!DOCTYPE html>
<script src=""></script>
<script src=""></script>
<script type="text/javascript" src=""></script>
<script type="text/javascript">
wadey / get_location_1.js
Created Dec 21, 2010
SimpleGeo JavaScript getLocation examples
View get_location_1.js
client.getLocation({enableHighAccuracy: true}, function(err, position) {
if (err) {
// Could not retrieve location information. Check err for more information
} else {
// Latitude and longitude available in position.coords
wadey / example-server.js
Created Dec 31, 2010
Example node-thrift server
View example-server.js
var thrift = require('thrift');
var JobExchange = require('./gen-nodejs/JobExchange'),
ttypes = require('./gen-nodejs/scheduler_types');
var server = thrift.createServer(JobExchange, {
insert_job: function(job, callback) {
// job is an instance of ttypes.Job
process.nextTick(function() {
View timeout-fails.js
// This example attempts to time out before the connection is established
var net = require('net');
var start =;
var stream = net.createConnection(9999, '');
View scheduler_client.js
var thrift = require('thrift');
var sys = require('sys');
var scheduler_thrift = require('./gen-nodejs/JobExchange.js'),
scheduler_ttypes = require('./gen-nodejs/scheduler_types.js');
var conn = thrift.createConnection('localhost', 8081),
client = thrift.createClient(scheduler_thrift, conn);
conn.on('error', function(err) {
View index.html
<!DOCTYPE html>
<style type="text/css">
@import url("");
html, body {height: 100%;}
svg {display: block;}
.layer circle {fill: #f00;stroke: #000;stroke-width: 2px;}
You can’t perform that action at this time.