I wanted to tell a story but realized I needed some background as to why it’s funny. I blogged about these once before, albeit very briefly. I thought I’d tell the story. It started a long time ago when I had an awesome job working at a student housing apartment complex. One of my coworkers gave me an awesome set of salt shakers. I displayed them because they were awesome. I lived with three other guys at the time so it wasn’t exactly out of the ordinary.
Fast forward a few months and I move in with my girlfriend. While we’re unpacking she holds them up and says:
“What’s this?” “Salt shakers.” “Uh huh. We’re throwing them away.” “Um, no. How about if I just throw away something of yours? Like your laptop.” “Fine but we’re putting them out of sight.”
I was about to protest but then I had an idea.
So I waited until she went to sleep and moved her alarm clock out of the way and put the salt shakers there so that she would hit those when she woke up instead of the snooze button. It worked! She said it was “very funny” and got ready for work.
The next morning they were staring at her in the bathroom when she went to get ready. She got smart this time and hid them. So I found them and put them in another spot and then another because she hid them every time.
One day she hid them really well and I didn’t find them for a couple of months. The next morning when she went to work they were staring at her on the dashboard of her car. When she got home I stole her keys again and grabbed them out of her glove compartment and hid them. She told me later she threw them away. Well, she thought she did and forgot all about it.
I waited until Christmas and took them with us to her family’s house and wrapped them up as a present to her. From her sister. It went well. She threw them away immediately. I fished them out of the garbage when no one was looking.
OK. Now we’re up to speed.
I’ve been having trouble sleeping lately and she had to work the night shift tonight sand was getting readty for work at 3:00 am. I’m still awake. She walks out of the bedroom and says “What are you still doing up?” For no specific reason I say “Shut up” in a Dr. Evil way. I keep it up when she says anything. It was just like that scene in Austin Powers.
I’m drinking Green Tea and she tells me it has caffeine in it. I tell her “No it doesn’t shut up.” She says “Google it.” So I go to Google and type in “should candace shut up” (note: no good results). So I had an idea.
I’m not quite sure why this happened, but I kept getting this error with Leopard and sqlite3:
LoadError: no such file to load -- sqlite3
I tried to gem install and uninstall sqlite3-ruby a few times but that didn’t work out. However, installing from source did. Head on over to the Rubyforge page and download the zip or tgz archive. Extract it and just run:
I did this talk at Blog Orlando 3 and thought some people might find this useful. Feel free to share and get in touch with me if you have any questions or comments.
Digidesign MBox 2 Mini - Awesome usb preamp that comes with pro tools. More of a “pro-sumer” item. This will only work with one mic at a time, though, so you’ll need a mixer of some sort if you want more.
Just got done doing a presentation with Gregg Pollack at the Ruby Hoedown. The talk was on Innovation in Ruby in the last year. You can grab a cheat sheet over on the Rails Envy web site.
Today while I was preparing the post, I remembered that Backpack had an API. A quick google turned up the Backpack API page with a link to the Ruby wrapper. About 10 minutes and some regular expressions later I had a script to auto format the weekly podcast links each week by just passing in the page id.
require'rubygems'require'XmlSimple'require'ruby_wrapper'
stories = []
backpack = Backpack.new('username', 'api key');
backpack.page_id='the page you want'
notes = backpack.list_notes
notes = notes['notes'].first['note']# {'title' => 'A note', 'id' => 'An id', 'content' => 'asdf followed by a url'}
notes.eachdo |note|
story_link = note['content'].scan(/(http\:\/\/.*)$/m)[0]
stories.push("<li><a title=\"#{note['title']}\" href=\"#{story_link}\" rel=\"nofollow\">#{note['title']}</a></li>".gsub(/\n/,''))endputs stories.join("\n")
However, this won’t give you the output you want. The open method on Open-URI leaves the output in the default character set of the page. If you want to convert it to utf-8, you need to use the iconv library:
require'rubygems'require'iconv'require'open-uri'require'hpricot'
f = open("http://url")
f.rewind
doc = Hpricot(Iconv.conv('utf-8', f.charset, f.readlines.join("\n")))
In January, I gave a presentation at the Orlando Ruby Users Group about unobtrusive javascript. I figured that I’d reproduce it here for anyone who wanted to watch it. Some topics covered in the video include semantic markup, benefits of coding unobtrusively, examples, and guidelines. Special thanks to Gregg Pollack for editing the video, and an extra special thanks to Jason Hawkins from Make Film Work for filming.