Skip to content

Instantly share code, notes, and snippets.

@kurtraschke
kurtraschke / test.html
Created September 15, 2011 21:58
Demonstration of polling disconnect in socket.io
<html>
<head>
<script src="/socket.io/socket.io.js"></script>
<script>
var connectTime;
var socket = io.connect('/', {transports: ['websocket', 'htmlfile', 'xhr-multipart', 'xhr-polling', 'jsonp-polling']});
socket.on('connect', function(){
console.log('connected');
connectTime = new Date().getTime();
@kurtraschke
kurtraschke / subviewer1.py
Created September 6, 2011 17:52
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
kurtraschke / subviewer.pde
Created September 6, 2011 16:56
Render archived MTA NYCT A Division ATS data
import processing.video.*;
MovieMaker mm;
OSMMercator om;
PFont theFont;
void setup() {
size(1280, 720);
smooth();
@kurtraschke
kurtraschke / README.markdown
Created August 13, 2011 02:21
XSLT stylesheet to translate WMATA Metrobus positions to KML

Get an API key from developer.wmata.com, and put it in buspos.sh.

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

  1. chmod +x buspos.sh
  2. chmod a+r bus.xslt
  3. mkdir cgi-bin
  4. mv buspos.sh bus.xslt cgi-bin
  5. python -m CGIHTTPServer 8001
@kurtraschke
kurtraschke / updatetweets.js
Created July 26, 2011 21:55
Google Apps Script to set cell comment to latest Tweet
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
kurtraschke / twitterlinks.js
Created July 26, 2011 21:45
Google Apps Script to turn Twitter usernames into links
@kurtraschke
kurtraschke / shortdoi.applescript
Created June 3, 2011 03:22
Set BibDesk URLs to ShortDOI shortcuts
(*
Set BibDesk URLs to shortDOI shortcuts
Kurt Raschke
kurt@kurtraschke.com
Licensed under the BSD license
*)
on run
tell application "BibDesk"
tell document 1
@kurtraschke
kurtraschke / newsmb.sh
Created December 23, 2010 16:21
Big Brother (bb4.com) script for monitoring SMB servers
#!/bin/sh
#set -x
#
###################################################################
# smb.sh Charles Gillanders charles.gillanders@toucan.ie
# Modified by Kurt Raschke <kurt@kurtraschke.com>:
# No longer requires a valid user/pass for each machine
# Minor bug-fixing; better handling of the "dialup" and "nonetpage" directives
#
# A Big Brother External Script
@kurtraschke
kurtraschke / nrc-atom.pl
Created November 22, 2010 02:43
NRC ENR Atom feed generator
#!/usr/local/bin/perl -T
#NRC ENR Atom feed generator
#Kurt Raschke
#kurt@kurtraschke.com
#Resources:
#http://linuxgazette.net/108/oregan2.html
#http://linuxgazette.net/109/oregan.html
#http://ttul.org/repos/cpan/trunk/Kwiki-Atom/lib/Kwiki/Atom.pm
Tue Jun 30 19:59:55 2015 :$GPZDA,235955.00,30,06,2015,00,00*68
Tue Jun 30 19:59:56 2015 :$GPZDA,235956.00,30,06,2015,00,00*6B
Tue Jun 30 19:59:57 2015 :$GPZDA,235957.00,30,06,2015,00,00*6A
Tue Jun 30 19:59:58 2015 :$GPZDA,235958.00,30,06,2015,00,00*65
Tue Jun 30 19:59:59 2015 :$GPZDA,235959.00,30,06,2015,00,00*64
Tue Jun 30 19:59:59 2015 :$GPZDA,235960.00,30,06,2015,00,00*6E
Tue Jun 30 20:00:00 2015 :$GPZDA,000000.00,01,07,2015,00,00*66
Tue Jun 30 20:00:01 2015 :$GPZDA,000001.00,01,07,2015,00,00*67
Tue Jun 30 20:00:02 2015 :$GPZDA,000002.00,01,07,2015,00,00*64
Tue Jun 30 20:00:03 2015 :$GPZDA,000003.00,01,07,2015,00,00*65