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
0 |
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
http://a.espncdn.com/combiner/i?img=/photo/2012/0306/ncb_u_barkleysmile_134.jpg | |
http://a.espncdn.com/combiner/i?img=/photo/2012/0326/grant_g_crawford_gb1_134.jpg | |
http://a.espncdn.com/i/columnists/reilly_rick_80fp.png | |
http://a.espncdn.com/i/columnists/simmons_bill_80fp.png | |
http://a.espncdn.com/i/ncb/ncaatourney12/fp_check_bracket.gif | |
http://a.espncdn.com/media/motion/2012/0325/dm_120325_nfl_ontheclock_robertgriffinIII_thumdnail_wbig.jpg | |
http://a.espncdn.com/media/motion/2012/0327/dm_120327_nfl_schefter_payton_parcells_thumdnail_wbig.jpg | |
http://a.espncdn.com/photo/2012/0326/as_zoom_134.jpg | |
http://a.espncdn.com/photo/2012/0326/mlb_g_suzuki_gb1_110.jpg | |
http://a.espncdn.com/photo/2012/0327/nba_a_dirky_cr_110.jpg |
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 | |
# | |
# Pressure-sensitive keyboard IO in Ruby (experimental MSFT hw!) | |
%w(rubygems serialport).each { |lib| require lib } # sudo gem install serialport pls | |
ser = SerialPort.new("/dev/tty.usbserial-A6007kA6", 115200, 8, 1, SerialPort::NONE) | |
ser.write("q") # initiate continuous ASCII mode | |
while true |
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 | |
#!/usr/bin/env ruby # MacPorts 1.87 | |
air = { | |
:input => ["JFK", "LGA", "EWR"], | |
:expected => ["JFK Airport", "LaGuardia Airport", "Newark Liberty International Airport"] | |
} | |
# Note that opensearch "Mount Whitney NGS" returns empty, but the Wikipedia on-site search tries to return something! |
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
This ruby script takes in a TSV of type co-occurrence probabilities, | |
does some simple filtering, and prints the output. | |
The filtered text file is suitable for node-link diagram visualization. |
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' | |
days = [] | |
(1..15).each do |pg| | |
query = 'days+ago+whendidyoujointwitter' | |
s = open("http://search.twitter.com/search.json?q=#{query}&rpp=100&page=#{pg}") | |
days << s.read.scan(/(\d+) days ago/).flatten.map { |st| st.to_i } | |
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
#!/usr/bin/env ruby | |
# primary source data: zteam car manifests :) | |
santabar = %w(AllisonF AnnieW Becky Brianna Brittany Chips Constance Dex | |
Emily Firebelly Frogger Galen LeslieR Lolo Lucy Marielle Marisa | |
RKelly Rosalie Scout Sparky Skiddo Tajah Tank Wushu) | |
davis = %w(AllisonF AnnieW Annika Ariana Brianna Chips Constance Emily | |
Firebelly Gina Izzy Laurel Lucy RKelly RachelL Rosalie SarahC |
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
<?xml version="1.0" encoding="utf-8"?> | |
<mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" | |
layout="vertical" | |
title="ZlibCompressor" | |
nativeDragDrop="onDrop(event)" | |
nativeDragEnter="onDragIn(event)" | |
> | |
<mx:Script> | |
<![CDATA[ | |
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[open-uri hpricot].each {|lib| require lib } | |
# get KML bbox and grab OSM XML | |
raise "no query arg specified" if ARGV.empty? | |
kml_filename = ARGV[0] | |
doc = Hpricot(open(kml_filename)) | |
coords = (doc/"coordinates")[0].inner_html.split.map { |x| x.split(',').map {|s| s.to_f } } | |
longs = coords.transpose[0] |
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[open-uri hpricot].each {|lib| require lib } | |
YAHOO_APP_ID = "[yourappidhere]" | |
FLICKR_KEY = "[yourapikeyhere]" | |
raise "alarms" if YAHOO_APP_ID =~ /here/ | |
raise "no query arg specified" if ARGV.empty? | |
# command line query => Y! where query => Flickr getInfo query => wget shapefile => ogr2ogr to KML |