Thursday, 11 October 2007 @ 3:06pm • life
Last night was the ANTM makeover episode. The makeover episode is my favorite from each cycle. Saleisha got a makeover, and now I think she looks kind of like the Peter Pan Guy.
Check this out:

I've also been thinking about adding a logo to my site. What do you guys think?

Posted by Aaron Patterson •
Permalink •
Comments (4) •
Leave your Comment »
Saturday, 6 October 2007 @ 9:55pm • computadora
I've been a fan of Damian Conway for a while now. One of my favorite modules he's written is Acme::Bleach. I thought I'd try writing my own in ruby, and this is what I came up with:
module Acme
class Bleach
TIE =
" \t" *
8
def initialize
(file
)
@shirt = File.
open(@file = file, 'rb'
) { |f|
f.
read
}.
gsub("require 'bleach'\n", ''
)
end
def dirty?; @shirt =~ /\S/; end
def dress?; @shirt =~ /^#{TIE}/; end
def whiten
TIE + @shirt.unpack('b*')[0].tr('01', " \t").gsub(/(.{9})/, '\1'+"\n")
end
def brighten
@shirt = [@shirt.gsub(/^#{TIE}|[^ \t]/, '').tr(" \t", '01')].pack('b*')
end
def fold
File.open(@file, 'wb') { |f| f.puts "require 'bleach'"; f.write whiten }
end
end
end
shirt = Acme::Bleach.new($0)
eval(shirt.brighten) unless shirt.dirty? && !shirt.dress?
shirt.fold
Store that in a file named "bleach.rb". Then in another file do something like this:
require 'bleach'
puts "hello world"
After you run it, your program will be bleached! yay! Thanks Damian!
Posted by Aaron Patterson •
Permalink •
Comments (2) •
Leave your Comment »