Skip to content

Instantly share code, notes, and snippets.

kurtraschke /
Created Dec 17, 2012
Find bounding box and convex hull of agency coverage (as WKT) for a OneBusAway TDS.
from mustaine.client import HessianProxy
from shapely.geometry import box
from shapely.ops import cascaded_union
service = HessianProxy("")
agencies = service.getAgenciesWithCoverage()
boxes = []
View gist:2016817
"Routes": [
"Name": "10:00:00 AM - 10A HUNT TOWERS-PENT ",
"RouteID": "10A"
"Name": "10:00:00 AM - 10A HUNT TOWERS-PENT ",
"RouteID": "10Av1"
kurtraschke / gist:1390328
Created Nov 24, 2011
WMATA bus API says there are no buses...
View gist:1390328
Kurt-Raschke:~ kurt$ curl
kurtraschke / test.html
Created Sep 15, 2011
Demonstration of polling disconnect in
View test.html
<script src="/"></script>
var connectTime;
var socket = io.connect('/', {transports: ['websocket', 'htmlfile', 'xhr-multipart', 'xhr-polling', 'jsonp-polling']});
socket.on('connect', function(){
connectTime = new Date().getTime();
kurtraschke /
Created Sep 6, 2011
Two approaches to visualizing MTA NYCT A Divsion ATS data in Google Earth
from csv import DictReader
from collections import defaultdict
import xml.etree.ElementTree as etree
from datetime import datetime
import pytz
from gtfs import Schedule
from gtfs.entity import Stop
kurtraschke / subviewer.pde
Created Sep 6, 2011
Render archived MTA NYCT A Division ATS data
View subviewer.pde
MovieMaker mm;
OSMMercator om;
PFont theFont;
void setup() {
size(1280, 720);
kurtraschke / README.markdown
Created Aug 13, 2011
XSLT stylesheet to translate WMATA Metrobus positions to KML
View README.markdown

Get an API key from, and put it in

If you don't happen to have a web server running, but you do have Python, do the following:

  1. chmod +x
  2. chmod a+r bus.xslt
  3. mkdir cgi-bin
  4. mv bus.xslt cgi-bin
  5. python -m CGIHTTPServer 8001
kurtraschke / updatetweets.js
Created Jul 26, 2011
Google Apps Script to set cell comment to latest Tweet
View updatetweets.js
function setComments() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var twitterDataRange = ss.getRangeByName("Twitter3");
vals = twitterDataRange.getValues();
for (i in vals) {
var row = vals[i];
for (j in row) {
var col = vals[i][j];
if (col.length > 0) {
kurtraschke / twitterlinks.js
Created Jul 26, 2011
Google Apps Script to turn Twitter usernames into links
View twitterlinks.js
kurtraschke / shortdoi.applescript
Created Jun 3, 2011
Set BibDesk URLs to ShortDOI shortcuts
View shortdoi.applescript
Set BibDesk URLs to shortDOI shortcuts
Kurt Raschke
Licensed under the BSD license
on run
tell application "BibDesk"
tell document 1