Skip to content

Instantly share code, notes, and snippets.

@renjiexu
renjiexu / gist:369d5a81bd8700490fbe
Created May 8, 2015 06:06
Caltrain Schedule parse
def getRouteNumber(lineNumber):
for name in colToRoute:
if lineNumber in colToRoute[name]:
return name
return "not found"
def amOrPm(row, col):
result = "AM"
@renjiexu
renjiexu / gist:3f1d8f618ad379847883
Created May 2, 2015 06:38
Script to convert bart schedule to some format I want...
amFile = open('am', 'r')
pmFile = open('pm', 'r')
extraAmFile = open('extraAm', 'r')
stopSchedules = {}
#isPM = True
names = ["Fremont", "Union City", "South Hayward", "Hayward", "Bay Fair", "San Leandro", "Coliseum", "Fruitvale", "Lake Merritt", "12th St. Oakland City Center", "19th St. Oakland", "MacArthur", "Ashby", "Downtown Berkeley", "North Berkeley", "El Cerrito Plaza", "El Cerrito del Norte", "Richmond"]
for line in amFile.readlines():
@renjiexu
renjiexu / 0_reuse_code.js
Last active August 29, 2015 14:14
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@renjiexu
renjiexu / debug_output
Created October 17, 2012 18:32
Ubuntu 12.04 Logitech Unifying Natural Scrolling does not work
* PyUDev
Input devices:
==============
event1 Power Button
event0 Power Button
event2 Logitech Unifying Device. Wireless PID:4002
event3 Logitech Unifying Device. Wireless PID:4011
event4 Dell WMI hotkeys