Monthly Archives: November 2006

Watermarking Photos using Ruby

The task: take a source photo of any size and overlay transparent text atop it. This is useful for asserting to the world that the image is yours (which it sometimes is). Before: After: First, some configurables: For this task I used the GD library. Step one, suck in the image: Step two: overlay the […]

STI and Multiple Databases in Rails

I admit, I believed it when DHH said that Rails apps should communicate via REST if they want access to a shared database. I bought into the hype and even wrote a plugin to make this easier. Well, it’s slow. I don’t have real numbers, of course, because I’m not the type of person to […]

Truncating HTML in Ruby

Update: You should read the comments, then check out the extended verion of truncate_html that uses Tidy. For the blogging Web site we wanted snippets of blog post for the front page and search results. This wasn’t a problem at all for our test blog posts, which we made by pasting lorem ipsum into a […]