My favorite iPhone apps

Achim treated himself to an iPhone and asked me for a list of my favorite apps. Since this wasn’t the first time someone asked for my opinion, I decided to write it up.

Before going into the details, I need to say that I don’t claim to have a good overview over what apps are available. So this is more like a list of my personal favorites than a directory. I ordered it by personal preference.

Here is the outline:

My Personal Favorites

#1 – NetNewsWire

I am a news junkie. I subscribe to more than 200 feeds, and NetNewsWire makes reading them fun. There are two features that stand out: First of all, it is very easy to mark an item as read and skip to the next unread item. Secondly, it allows to mark a whole feed as read, so that all known articles do not appear as new anymore. Plus it syncs with Google Reader (incl. unread marks) – this makes it very easy to add new feeds or continue reading on the PC.

There is only one con – it has advertisements in the article list. If there was a way to pay for the app and get rid of the ads, the app would be the best thing on earth.

Continue reading

Rewriting WordPress in Rails

Earlier when I wrote that I didn’t like the template language WordPress uses, I also made the joke about rewriting WP in Rails. Well, today I thought “Let’s give it a try”. Not that I seriously want to rewrite WP, but I was curious to see how Rails can deal with legacy database schemas.

I was up and running pretty quickly: Pointed database.yml to my WP’s database, created Post and Author models as well as a post_controller. It was doing what I inteded it to do after a couple of minutes, but I didn’t like the column names (resulting in the attributes of the objects). It would have been too easy to write a new pair of accessor and mutator with nice names for each ugly column name. But, after all, Rails promotes the DRY principle, so I was looking for a better means to map column names to nice attrbute names.

So I found Joshua Sierles posting “Rails aliasing of database column names”, However, I wasn’t able to get it to run from the project’s lib directory, so I created a Rails plugin for it. I works well for me, and it’s good Rails style to put extensions into plugins.

If you like the functionality, you can download the plugin (alias_column.zip) and unzip it into the vendor/plugins directory of your Rails project. The plugin works exactly as Joshua describes.

I found one caveat, however. It doesn’t seem possible to use dynamic finders with the alias_column. I map the post_status column of the wp_post table to status, so I can call

p = Post.find :first
p.status

which works fine. But using p.status instead of p.post_status doesn’t work for the find methods. I want to call

Post.find_all_by_status ‘publish’

but it just throws an error saying

undefined method `find_all_by_status’ for Post:Class

Please leave a comment or mail me if you have an idea how to get this to work.

Good enough

Finally, I got my act together and installed WordPress in order to reactivate my home page. Installation was smooth, but my lack of CSS skills made the customization a not-so-pleasant trip. But, it’s good enough to get started.

I am planning to migrate the old content over piece by piece, let’s see how this goes. I had a lot of custom PHP tags in there, so I will have to fiddle around with regular expressions a lot.

I don’t like the template language of WP, however. It does not return objects, but rendered strings, which is a clear violation of the layering principle. For instance, I tried to put the links to pages in the header section (header of WP, not HTML). I expected to get an array or hash of pages and links to them, instead it returned a huge string of HTML with <li> and other stuff mixed in.

What if I don’t want to present the list of pages as a list? Well, I guess I had too much Rails lately …