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
| #!/usr/bin/env python | |
| import serial, sys | |
| DEVICE='/dev/cu.usbserial-A7006gOH' | |
| IDS={ | |
| '28001D71E1': 'Ross', | |
| '0800D9D1AB': 'Steve', | |
| } |
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
| #!/usr/bin/env python | |
| import datetime, serial, subprocess, sys, time | |
| DEVICE='/dev/cu.usbserial-A7006gOH' | |
| IDS={ | |
| '28001D71E1': 'Ross', | |
| '0800D9D1AB': 'Steve', | |
| '2200562718': 'Edd', | |
| '2500718C43': 'Danny', |
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
| #!/usr/bin/env python | |
| import csv | |
| def tsv_to_csv(filename="data.tsv", output="data.csv"): | |
| f = open(filename) | |
| out = csv.writer(open(output, "wb")) | |
| for line in f: | |
| out.writerow(line.strip().split("\t")) | |
| f.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
| #!/usr/bin/env python | |
| import csv | |
| def fill_in_blanks(filename="data.csv", output="data-no-blanks.csv", interval=60): | |
| f = csv.reader(open(filename)) | |
| out = csv.writer(open(output, "wb")) | |
| last = None | |
| # Deal with headers | |
| out.writerow(f.next()) |
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
| #!/usr/bin/env python | |
| import csv | |
| from sqlalchemy import * | |
| def csv_to_mysql(filename="data-no-blanks.csv"): | |
| # Prepare db connection (SQLAlchemy stuff) | |
| db = create_engine("mysql://root:root@localhost/datacopter_thepromise") | |
| metadata = MetaData(db) |
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
| /* | |
| For more detailed instructions on how to use this script, sign up with your email here: | |
| http://adamloving.com/internet-programming/how-toexport-facebook-page-fans | |
| DISCLOSURE: This javascript runs in your browser pretending to be you | |
| looking through your page fans. Facebook should have no problem with this, | |
| but who knows if they will think it is strange to see you looking through | |
| all your fans so quickly (the script waits 3s before requesting each page). | |
| I've had no problem running this so far for 1000s of page fans, but I |
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
| // TODO: remove spaces and newlines | |
| javascript:(function(){ | |
| s=document.createElement('script'); | |
| s.type='text/javascript'; | |
| s.src='http://closure-compiler.appspot.com/code/jscc3f366b3fa0cbd851abb5b804192c398/default.js'; | |
| document.body.appendChild(s); | |
| })(); |
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
| // Via http://www.learningjquery.com/2009/04/better-stronger-safer-jquerify-bookmarklet | |
| (function() { | |
| var el=document.createElement('div'), | |
| b=document.getElementsByTagName('body')[0], | |
| otherlib=false, | |
| msg=''; | |
| el.style.position='fixed'; | |
| el.style.height='32px'; | |
| el.style.width='220px'; | |
| el.style.marginLeft='-110px'; |
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
| #!/usr/bin/env python | |
| """ | |
| Simple script to combine a bunch of GeoJson files that each specify a single Polygon into a MultiPolygon GeoJson object. | |
| """ | |
| import json, sys | |
| def combine(*args): | |
| combined = {"type": "MultiPolygon", "coordinates": []} |
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
| #!/bin/bash | |
| curl http://www.nextdayvideo.com:8000/room_2.ogv > stream2.ogv & | |
| sleep 4500 | |
| kill $! 2>/dev/null && echo "finished! :)" |