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
// = Name | |
// tracker.js | |
// Douglass - Cross-browser, cross-platform alternative to CTA BusTracker | |
// | |
// = Description | |
// The ChicagoTransit module queries the CTA BusTracker Service using the | |
// official version 1.0 API. CTA uses the BusTime system to provide developers | |
// with real-time route information through BusTracker. The BusTracker Service | |
// allows deveopers to make HTTP requests and recieve XML responses. The CTA | |
// provides {official API documentation (PDF)}[http://www.transitchicago.com/assets/1/developer_center/BusTime_Developer_API_Guide.pdf], |
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 More up()s than just deleting elements, e.g. | |
// - Swapping random elements | |
// - Removing random bits of HTML | |
function up(i) { | |
var k = Math.floor(Math.random() * i) % i; | |
var l = Math.floor(Math.random() * i * k) % i; | |
console.log( 'Deleting element: ' + l ); | |
console.log( $('body *:eq(' + l + ')').remove() ); | |
} |
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 ruby | |
require 'open-uri' | |
require 'nokogiri' | |
require 'yaml' | |
# Course, username, password | |
# e.g. ./classesdev-lookup.rb AFAM20005 mycnetid 'mysecretpassword' | |
exit(1) unless ARGV.length == 3 | |
course = ARGV[0] | |
course_php = 'https://classesdev.uchicago.edu/courseDetail.php?courseName=' |
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
function swap() { | |
if ($(window).data('on') === undefined) { | |
$('body').remove(); | |
$('html').css('background', 'white'); | |
$(window).data('on', false); | |
} | |
if ($(window).data('on')) { | |
$('html').css('background', 'black'); | |
$(window).data('on', false); |
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 ruby -w | |
class Array | |
def second | |
self[1] | |
end | |
end | |
class Symbol | |
def to_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
#!/usr/bin/ruby | |
# Updated 2010-01-10 by Sean Clemmer | |
# | |
# Overkill | |
class Case | |
attr_reader :number, :value | |
def initialize( number, value ) | |
@number = number | |
@value = value |
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 ruby | |
# = Name | |
# University of Chicago TimeSchedules Spy (ScheduleSpy) | |
# | |
# = Description | |
# The ScheduleSpy watches the University of Chicago TimeSchedules system for | |
# openings in the classes you want. Pass the system the name of the classes, | |
# and watch for Growl notifications keeping you abreast of any openings. | |
# | |
# = License |
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/ruby | |
require 'yaml' | |
# Need a file for our list | |
unless File.exists?( ".todo" ) | |
todo_file = File.open( '.todo', 'w' ) | |
todo_file.puts( '---' ) | |
todo_file.close | |
end |
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
# = Name | |
# Chicago Transit Authority BusTracker Service API | |
# | |
# = Description | |
# The ChicagoTransit module queries the CTA BusTracker Service using the | |
# official version 1.0 API. CTA uses the BusTime system to provide developers | |
# with real-time route information through BusTracker. The BusTracker Service | |
# allows deveopers to make HTTP requests and recieve XML responses. The CTA | |
# provides {official API documentation (PDF)}[http://www.transitchicago.com/assets/1/developer_center/BusTime_Developer_API_Guide.pdf], | |
# and you can request an access key at the {API homepage}[http://www.transitchicago.com/developers/bustracker.aspx]. |
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 | |
# del | |
# "Safe" version of rm | |
# Updated 2010-01-13 by Sean Clemmer | |
# | |
# If I learned one thing writing this script it's as follows: | |
# When in doubt, quote. | |
# At the very least, this thing can handle spaces | |
usage="USAGE: del [-vler] file*" |
OlderNewer