View Andy Lo-A-Foe's profile on LinkedIn

Rails’ end_of_month fixed

In Rails 2.0.x the end_of_month now properly gives you the end of month e.g. Mon Jun 30 23:59:59 +0200 2008, instead of Mon Jun 30 00:00:00 +0200 2008, which was the case in Rails 1.2.x (see this previous post). Good thing I caught this, since it used to inside the Nota module of Beldienst. We [...]

Massive memory leak in ruby-gettext 1.90.0

Just found out there’s a massive memory leak in ruby gettext 1.90.0, one of our applications started eating GBs of RAM after a couple of days in use. So If you’re using gettext for translating your Rails app take note! You can grab the current trunk which has a fix for this.

Torturing Ruby (and laughing at your own code)

While cleaning up some code I ran across some obscure code of mine from my Ruby youth. I remembered reading about an ultra cool Ruby tool the other day so I decided to give my code a good flogging. The victim for tonight is a method used to slice ID numbers into chunks of at [...]

Switch from Typo to Mephisto

After the final botched Typo upgrade I gave up on it and am now serving this blog from Mephisto (0.7.3). The migration went fine. Luckily I still had a copy from the old Typo database structure since the Typo SVN version is not compatible with the migrations scripts from Mephisto. So far everything seems to [...]

Rewriting a (large) PHP application in Rails, part 2

In my previous post on this topic I described the method we used to convert
a legacy MySQL PHP database to a Rails conformant PostgreSQL hosted version. In this article I will tell a bit about how we converted the HTML of the application to Rails layout templates and partials.

Extracting HTML from Firefox DOM

We first started [...]

Rewriting a (large) PHP application in Rails, part 1

In recent weeks I was busy converting a fairly large PHP application to Rails. The existing PHP application is about 65.500 lines of intermingled PHP and HTML/CSS code. Yep, a classic PHP application without any database abstraction layer, no templating, no MVC. This is why I dubbed it “large”, but replacing that with “crappy” would [...]