Skip to content

Instantly share code, notes, and snippets.

@pete
pete / gist:29245
Created November 26, 2008 02:42 — forked from ab5tract/gist:29216
def require(lib)
@paths ||= []
return false if @paths.include?(lib)
$:.each { |path|
['','.rb','.so'].each { |ext|
l = "#{path}/#{lib}#{ext}"
if File.exist?(l)
@paths << l
load l
return true
@pete
pete / gist:14690
Created October 4, 2008 01:17 — forked from prem/gist:14688
require 'net/http'
urls = %w(
http://irvsrdves3.flight.yellowpages.com:8080/smm/ypc?field=city_state_business&imei=353763.01541827.6&grammar=/data1/lm/test.lm
http://research.yellowpages.com:8080/smm/ypc?field=city_state_business&imei=353763.01541827.6&grammar=/data1/lm/test.lm
)
urls.each { |url|
puts url
uri = URI.parse url