Skip to content

Instantly share code, notes, and snippets.

syndaemon -i 1 -d -k
@tlevine
tlevine / sophas_gre_hack.js
Created September 21, 2011 04:53
GRE score input hack
/* The SOPHAS application (https://portal.sophas.org)
requires that your GRE Writing score be an integer.
My GRE writing score is not an integer.
Fortunately, they didn't validate their form server-side.
Run this in the Javascript console before clicking
"Save" on the GRE scores page in order to allow
non-integer GRE writing scores
*/
@tlevine
tlevine / fb_expand.js
Created October 4, 2011 03:36
Expand someone's facebook wall
//Run this on the person's facebook profile page to expand the wall
var INTERVAL=2000; // Time between wall expansions, in milliseconds
var MAX_TRIES=50; // How many times to try expanding the wall
function expand(){
var foo=document.getElementById('profile_pager').children[0].children[0].children[0].children[0].onclick;
if (typeof(foo)!='undefined'){
foo();
}
}
@tlevine
tlevine / stacktrace.py line 68
Created April 10, 2012 13:08
Error that I've been seeing recently
Traceback (most recent call last):
File "/home/startup/exec.py", line 111, in <module>
etb = scraperwiki.stacktrace.getExceptionTraceback(code)
File "/home/scraperwiki/python/scraperwiki/stacktrace.py", line 68, in getExceptionTraceback
result = { "message_type":'exception', "exceptiondescription":"%s: %s" % (exc_value.__class__.__name...more
UnicodeEncodeError: 'ascii' codec can't encode characters in position 24631-24633: ordinal not in range(128)
Finished: 8.962 seconds elapsed, exit status 1
runfinished
@tlevine
tlevine / accelerometer.ino
Created August 12, 2012 18:15
Basic accelerometer CSV output
#include <Time.h>
/*
I have an accelerometer plugged into pins A0, A1 and A2 of an Arduino,
and I'm writing a CSV file (well the line breaks are wrong) to serial.
It depends on the time library (http://www.arduino.cc/playground/Code/Time),
which you install by extracting the download in the arduino `libraries`
directory and restarting arduino. (This actually provides three libraries.)
#!/bin/sh
# Print the current time and how far we are along the day, week and year.
# https://twitter.com/tmcw/status/239516909450711040
# https://gist.github.com/3472701
# https://gist.github.com/3474085
# Tom actually wants to see how much of his life is left.
# https://twitter.com/tmcw/status/239603708973957120
@tlevine
tlevine / foo
Created September 13, 2012 19:31
Stuff I installed for make install
tlevine@desk:~/Documents/realtimestream/simplehttp/simplehttp$ sudo ma
0. (Dunno what to put here; I already had most of the dependencies)│ke install
1. `sudo pip2 install numpy "pysimplehttp>=0.2.1" host_pool` │/usr/bin/install -d /usr/local/lib/
2. `sudo pip2 install ujson` │/usr/bin/install -d /usr/local/include/simplehttp/
* Note: If you get an error installing ujson, don't sweat it. No│/usr/bin/install libsimplehttp.a /usr/local/lib/
thing depends on it, but it is a really great and fast alternative to│/usr/bin/install simplehttp.h /usr/local/include/simplehttp/
json/simplejson. │/usr/bin/install simplehttp.h /usr/local/include/simplehttp/
4. `git submodule init` │/usr/bin/install queue.h /usr/local/i
@tlevine
tlevine / gist:3733151
Created September 16, 2012 16:45
GnuCash menu option locations
tlevine@desk:~/Documents/gnucash$ grep -r RemoveTran .
./src/gnome/gnc-plugin-page-register.c: "RemoveTransactionSplitsAction", GTK_STOCK_CLEAR, N_("Remo_ve Transaction Splits"), NULL,
./src/gnome/gnc-plugin-page-register.c: "RemoveTransactionSplitsAction",
./src/gnome/gnc-plugin-page-register2.c: "RemoveTransactionSplitsAction", GTK_STOCK_CLEAR, N_("Remo_ve Transaction Splits"), NULL,
./src/gnome/gnc-plugin-page-register2.c: "RemoveTransactionSplitsAction",
./src/gnome/ui/gnc-plugin-page-sxregister-ui.xml: <menuitem name="RemoveTransactionSplits" action="RemoveTransactionSplitsAction"/>
./src/gnome/ui/gnc-sxed-window-ui-full.xml: <menuitem name="RemoveTransactionSplits" action="RemoveTransactionSplitsAction"/>
./src/gnome/ui/gnc-sxed-window-ui-full.xml: <menuitem name="RemoveTransactionSplits" action="RemoveTransactionSplitsAction"/>
./src/gnome/ui/gnc-plugin-page-register-ui.xml: <menuitem name="RemoveTransactionSplits" action="RemoveTransactionSplitsAction"/>
./sr
@tlevine
tlevine / money.csv
Created September 21, 2012 17:20
Find high money references in FALLOS documents, and save them to a spreadsheet.
filename money
37904-09.txt
31329.txt
31316.txt
67217.txt
7530-C.txt
P36011.txt
7056-08.txt
31402.txt
30705.txt
@tlevine
tlevine / gist:4032183
Created November 7, 2012 15:15
Home host ideas
This power outage is prompting me to set up my redundant home box/directory/environment.
Here are some ideas of places to try.
leb top providers for the past quarter