Skip to content

Instantly share code, notes, and snippets.

class Regexp
def self.from_glob(glob)
Regexp.new(['^',Regexp.escape(glob).gsub('\\*','(.*)').\
gsub('\\\(.*)','\*').\
gsub('\\[','([').\
gsub('\\]','])').\
gsub('\\?','(.)'),'$'].join)
end
end
env:
OSX v10.4.11
Python 2.5
mercurial v1.2.1
git v1.6.3.1
repos:
using python repository as of 2009-06-18
@thinkcreate
thinkcreate / bitly.rb
Created June 9, 2009 12:51
Bitly client
class Bitly
include HTTParty
base_uri 'api.bit.ly'
default_params :version=>'2.0.1'
format :json
def initialize(login, key)
@auth = {:login => login, :apiKey => key}
require File.dirname(__FILE__) + '/models'
class ActiveWoningnet
def initialize
@address = "<address known>"
@b = Selenium::Client::Driver.new("localhost", 4444, "*firefox", @address, 10000);
@b.start_new_browser_session
end
def login