Skip to content

Instantly share code, notes, and snippets.

Andrew Turley aturley

Block or report user

Report or block aturley

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
aturley /
Created Oct 4, 2011
The Processing sketch takes pictures, encodes them as strings, and writes them to a fifo. The shell script reads from the fifo, sticks the string into a json object, and publishes to the swarm. The HTML file gets data from swarm and draws the picture.
cat ~/swarmpix | sed 's/^\(.*\)$/{"x":"\1"}/' | ./ produce 660e96311f5ca4c39053726d2d0c81f2661a8ef3 00:23:12:55:73:b7 pic
aturley /
Created Feb 24, 2012
reload the active document in Chrome
echo 'tell application "Google Chrome" to tell the active tab of its first window
end tell' | osascript -
aturley / heapdump.js
Created Mar 22, 2012
This generates a heapdump.
View heapdump.js
var profiler = require('v8-profiler');
var MyClass = function(x) {
this.x = x;
MyClass.prototype.getX = function() {
return x;
aturley / moog.5.js
Created May 23, 2012
Prettified version of the main javascript source ( for the Moog Google Doodle (thanks to
View moog.5.js
(function () {
try {
var g = void 0,
i = !0,
j = null,
k = !1,
l, o = this,
aa = function () {},
ba = function (a) {
var b = typeof a;
aturley /
Created May 24, 2012
emacsclient-like scripts for open files in remotely running emacs instances. Run on the machine running emacs (don't forget to start-server in emacs) and use FILENAME to open files. You need to have tramp set up in emacs, a
if [ -z "${EMACSCLIENT_HOST}" ]; then
echo "EMACSCLIENT_HOST is not set!"
exit 1
if [ -z "${FILENAME}" ]; then
aturley /
Created Jun 2, 2012
That's Numberwang!
import random, sys, os
name = [None, None]
sys.stdout.write("enter player 1: ")
name[0] = sys.stdin.readline().strip()
sys.stdout.write("enter player 2: ")
aturley / gist:2955828
Created Jun 19, 2012
regex vs split and test in Python
View gist:2955828
aturley@silverslab [~/play]$ cat
import time
import re
url = ""
url_x = ""
url_l = "
aturley / git-codecheck
Created Jun 20, 2012
Run pep8 and pylint on all of the new and modified Python files in a git repo.
View git-codecheck
if [ -z "$(which pep8)" ];
echo "Could not find pep8"
exit 1
if [ -z "$(which pylint)" ];
aturley / ga_invite.rb
Created Jun 20, 2012
GA code snipped
View ga_invite.rb
if know_code = true
print "forward this email to 5 friends."
print "teach me how to code!"
aturley /
Created Jun 27, 2012
Minimum python file that gets a 10/10 from pylint
You can’t perform that action at this time.