August 2008
7 posts
Aug 30th
Aug 23rd
Aug 23rd
Aug 22nd
require ‘open-uri’require ‘hpricot’ class Gistr  def initialize(gist_id)    @gist_id = gist_id  end   def post(email, password, title)    post_to_tumblr(email, password, title, gist_code)  end   def gist_code    return @gist_code if @gist_code     # Use the secret .pibb format    code =...
Aug 11th
1 note
# Parallel map# Originally from http://project.ioni.st/post/2332#snippet_2332class Array  def pmap    threads = []    0.upto(size - 1) do |n|      threads « Thread.new do        yield(at(n))      end    end    threads.collect {|thread| thread.value}  endend # Trade-off between resource consumption# and speed of execution.# Much faster in some scenarios, # much...
Aug 10th
## Created by Eric Lindvall <eric@5stops.com>## Making it simple to provide input for http://wordle.net/create## require ‘rubygems’gem ‘mechanize’require ‘mechanize’ def collect_entries(page)  page.parser.search(‘.entry-content’).collect do |span|...
Aug 10th