Skip to content

Instantly share code, notes, and snippets.

View will's full-sized avatar
🆒
ه҈ͣفͤ҈ͥ҉ͦ҈ͧ҉ͨ҈ͩ҉ͪ҈ͫ҉ͬ҈ͭ҉ͮ҈ͯ҉ͨ҈ͬ҉ͧ҈ͣ҉ͨ҈ͧ҉ͯ҈ͮ҉ͭ҈ͤ҉ͦ҈ͥ҉ͧ҈ͩ҉ͭ҈ͨ҉ͣ҈ͪ҉ͧ҈ͭ҉ͩ҈ͤ҉ͮ҈ͯ҉ͬ҈

Will Leinweber will

🆒
ه҈ͣفͤ҈ͥ҉ͦ҈ͧ҉ͨ҈ͩ҉ͪ҈ͫ҉ͬ҈ͭ҉ͮ҈ͯ҉ͨ҈ͬ҉ͧ҈ͣ҉ͨ҈ͧ҉ͯ҈ͮ҉ͭ҈ͤ҉ͦ҈ͥ҉ͧ҈ͩ҉ͭ҈ͨ҉ͣ҈ͪ҉ͧ҈ͭ҉ͩ҈ͤ҉ͮ҈ͯ҉ͬ҈
View GitHub Profile
def method_stack
@method_stack ||= []
end
def method_missing(sym, *args)
method_stack << [sym, args]
self
end
#!/usr/bin/env ruby
# datamapper woes
# Case one: adding an object to an association using << blows up
# Case two: setting an association with a new array doesn't clear
# out the old one, it just combines them
# output:
# line 49: post.tags << t1 # => #<DataMapper::Associations::ImmutableAssociationError: You can not modify this association>
# line 74: book.authors == [ a1 ] # => true
#!/usr/bin/ruby
require "rubygems"
require "scrapi"
url =
"https://ui2web1.apps.uillinois.edu/BANPROD1/bwckschd.p_disp_detail_sched?term_in=120091&crn_in=43437"
seats = Scraper.define do
array :numbers
process "td.dddefault", :numbers=>:text
# will leinweber's lib/helpers.rb for webby
def first_post
all_posts.first
end
def next_post(post)
all_posts[ all_posts.rindex(post) - 1 ]
end
@will
will / response.txt
Created February 20, 2009 22:21 — forked from jseifer/gist:67727
On Feb 20, 2009, at 4:24 PM, "Olusegun A.A" <xxxxxx@gmail.com> wrote:
** CRAIGSLIST ADVISORY --- AVOID SCAMS BY DEALING LOCALLY
** Avoid: wiring money, cross-border deals, work-at-home
** Beware: cashier checks, money orders, escrow, shipping
** More Info: http://www.craigslist.org/about/scams.html
Hello,
Do you still have this item available for sale at the moment? Get back asap.
# so ugly, but it makes rails treat CouchRest::Documents correctly
class Hash
class << self
alias :old_trip_equal :===
def ===(other)
return false if other.class.ancestors.include?(CouchRest::Document)
old_trip_equal other
end
end
#!/usr/bin/env jruby
require 'rubygems'
require 'celerity'
url = "http://uiuc.us/jquery.html"
puts "url should be #{url}"
[:firefox, :internet_explorer].each do |browser|
b = Celerity::Browser.new :log_level => :severe, :browser => browser
b.goto url
require 'metric_fu'
task "metrics:all" do
require 'yaml'
require 'couchrest'
require 'grit'
report = File.open( File.join( RAILS_ROOT, "tmp", "metric_fu", "report.yml") ) { |f| YAML::load f }
repo = Grit::Repo.new(Dir.pwd)
commit = repo.commits.first

Twilight Zone Watchlist

fork this list and add/remove suggestions or move things up to the watch queue please!

queue

  1. The Obsolete Man
  • The Monsters Are Due On Maple Street
  • Eye of the Beholder
  • Time Enough At Last
module Integrity
class Notifier
class Arduino < Notifier::Base
def self.to_haml
""
end
def deliver!
if build.failed?
Arduino.send "r"