Archive for March 2008


Hpricot and utf-8

March 18th, 2008 — 6:07pm

I tried to use Hpricot to parse a page with special characters in a utf-8 encoding. The docs tell you to do this:

require 'rubygems'
require 'open-uri'
require 'hpricot'
 
doc = Hpricot(open("http://url/"))

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")))

4 comments » | ruby

Unobtrusive Javascript

March 13th, 2008 — 6:56am

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.


Unobtrusive Javascript Presentation from Jason Seifer on Vimeo.

1 comment » | Javascript

The Best Salt Shakers In The World

March 3rd, 2008 — 9:13am
Tragedy Strikes

It was a true tragedy I didn’t win this.

 

1 comment » | Misc

Back to top