This file contains 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
require 'rubygems' | |
require 'net/http' | |
require 'uri' | |
require 'hpricot' | |
def get(url) | |
uri = URI.parse(url) | |
http = Net::HTTP.new(uri.host, uri.port) | |
http.use_ssl = true | |
http.verify_mode = OpenSSL::SSL::VERIFY_NONE |
This file contains 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
#1 https://twitter.com/mikiobraun/status/434321864249184256 | |
#2 https://twitter.com/josephreisinger/status/434320973878161409 | |
#3 https://twitter.com/mdreid/status/434264621227073536 | |
#4 https://twitter.com/rickyrobinson/status/434241202200662016 | |
#5 https://twitter.com/pmarca/status/434215519630008321 | |
#6 https://twitter.com/cdixon/status/433468068237692928 | |
#7 https://twitter.com/sacca/status/433467363623583745 | |
#8 https://twitter.com/trammell/status/433462737151488000 | |
#9 https://twitter.com/danadanger/status/433462152590929921 | |
#10 https://twitter.com/omid/status/433460895323127808 |
This file contains 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
require 'time' | |
require 'rubygems' | |
require 'json' | |
def usage | |
puts <<EOS | |
Usage: | |
ruby track_stream.rb <username> <password> <keyword1> <keyword2> ... | |
EOS | |
end |
This file contains 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 | |
# -*- ruby -*- | |
# Usage: | |
# ruby printjson.rb field1 fields2 file | |
# | |
# if file == '-' then read from stdin | |
# | |
# Install the json gem first: | |
# |
This file contains 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
# gems you need | |
# | |
# dbi | |
# dbd-jdbc | |
# jdbc-postgres | |
require 'java' | |
require 'rubygems' | |
require 'dbi' |
This file contains 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 file extends the Kernel's require function and adds the | |
# AutoReload module which allows to reload files once they have changed | |
# on the disk. | |
# | |
# Basically, you just require your files as usual, and if you want to update | |
# the files, either call AutoReload.reload(file) or AutoReload.reload_all. | |
# | |
# Usage: | |
# irb -rautoload | |
# |
This file contains 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 | |
# | |
# Script to bundle this rails app with compiled ruby files. | |
# The main problem is that rails very much assumes that files | |
# end in ".rb", although jruby is also fine with loading | |
# ".class" files. | |
# | |
# The "solution" is to replace each ".rb" file with a file | |
# which loads the associated ".class" file. |