Convert your Rails' application database to UTF-8

Posted by Andrew

Its unlikely that this will ever matter in local development, but its good practice to have your environment properly setup.

Dump your database to a file:
$ mysqldump -u root --default-character-set=latin1 --skip-set-charset project_development > project_development.sql

Convert the characters in that file from latin1 to UTF-8 using iconv:
$ iconv -f latin1 -t UTF-8 project_development.sql > project_development_utf8.sql

Drop your existing database and recreate it with the appropriate defaults:
$ mysql -u root --execute="drop database project_development; create database project_development character set utf8 collate utf8_general_ci;"

Repopulate your database with your converted data:
$ mysql -u root project_development < project_development_utf8.sql

Don’t forget to add the encoding to your database.yml!

adapter: mysql
database: project_development
username: root
password: 
host: localhost
encoding: utf8

Site Specific Browsers (SSBs)

Posted by Andrew

I just spent a few minute setting up Site Specific Browsers for my Google Apps. Using Fluid, which was inspired by Mozilla’s Prism, and some nice icons left me with a pretty cool setup – little red badges even show up on my icons if I have unread mail or feed items.

Dock

The Power Of Social Networking: Last.fm Gets It Right

Posted by Andrew

While tinkering away with Evan Weaver’s sweeper (a ruby gem for updating id3 tags of mp3s based off last.fm’s fingerprint database) I started clicking around my last.fm profile. I’ve been a religious scrobbler for a few years now (nearly 20,000 songs since May 4th, 2004), but I had never stopped to think about how powerful all of this data could be. I mostly used last.fm for its music recommendations; my profile page will suggest artists for me to explore based off what I have listened to in the past.

Today, I discovered an even cooler feature: events. Last.fm knows what I like, and it knows about lots of events (concerts, shows, festivals). By combining this data, the service can build me a custom calendar of upcoming acts that I may be interested in! I’ve created a quick mash-up using 30 boxes iCal support to display the information on the web, but I have already added this calendar to my personal google calendar. Now, even as my music tastes change, and I move around, I will always have calendar of upcoming events in my area that I will likely be interested in attending. It makes even more sense that CBS spent big money to acquire these guys.

Graduations

Posted by Andrew

Its that time of year again—Graduation. I just want to congratulate everyone on their successes.