Ruby

29 05 2011 : Mailcatcher for Drupal and other PHP-applications - The simple version

This is an updated version of my earlier post. Since msmtp is no longer needed, things are a lot simpler, hence the new article.

Problem: on development (and test) you don’t want to send out mail. But you /do/ want to test it. You certainly don’t want to be in my shoes when a client called me, telling she recieved dozens of confused and angry mails from users on her site, after I fired up cron on my local development machine. And sent out approximately 3000 notification mails to users, with stuff like “new post for you: “W000t, fieldz0rz developmentz in CCK is workinggggg!” (I am making this up now. Allthough…. ;) ) Problem: when debugging mail, you want to inspect the headers and often (in case of multipart or HTML mail) the source too. Most emailclients are crap for that (and right so: who other then the odd mail/webdeveloper needs to inspect the source of a mail. ever?)

Solution: the brilliant Ruby application named mailcatcher. This is a simple SMTP server and sendmail replacement that shows the mails sent to it in a handy webapplication. The webapplication features debug-tools such as headers, and source displaying.

Screenshot of a Drupal password recorvery mail in Mailcatcher


28 05 2011 : Mailcatcher for Drupal and other PHP-applications

UPDATE Please see the version of this article, the latest malcatcher has its own sendmail replacement, making installation for PHP a lot simpler.

Problem: on development (and test) you don’t want to send out mail. But you /do/ want to test it. You certainly don’t want to be in my shoes when a client called me, telling she recieved dozens of confused and angry mails from users on her site, after I fired up cron on my local development machine. And sent out approximately 3000 notification mails to users, with stuff like “new post for you: “W000t, fieldz0rz developmentz in CCK is workinggggg!”. Not cool.

Problem: when debugging mail, you want to inspect the headers and the source (in case of multipart or HTML mail). Most emailclients are crap for that (and right so: who other then the odd mail/webdeveloper needs to inspect the source of a mail. ever?)

Solution: the brilliant Ruby application named mailcatcher. This is a simple SMTP server, which shows the mails sent to it, in a handy webapplication. The webapplication features debug-tools such as headers, and source displaying.

Screenshot of a Drupal password recorvery mail in Mailcatcher


29 03 2011 : Simplest authentication in Rails: Basic Authentication with a logged_in? helper.

The, by far, simplest solution to add some form of authentication in Rails is basic authentication. It has a lot of downsides, but the simplicity is such a benefit that it may just outweight.

Downsides are, amongst others:

  • No users, no user-manangement.
  • Your username and password are hardcoded in the application.
  • No fancy or good looking login screens: just the basic HTTP login provided by your browser.
  • No logout, other then closing the browser.

Here is a simple implementation for a simple app I needed.


03 07 2008 : Quick and Dirty Vitalist to Rememberthemilk migration script.

Because I decided to try Remember the milk again for my Getting Things Done thingies, I had to import all my stuff from vitalist.com.
In order to do so, I hacked together a dirty Ruby script.

It may help someone who is trying to achieve the same.


27 09 2007 : Snipplr Drupal's code snippet feed

Nice tip for all the Drupal hackers out there: snipplr code snippets for Drupal. It also has an RSS feed. Obviously, as with any unknown source, one should never ever use these snippets (except when you know PHP well).

Oh, and there is a nice jQuery feed too.


26 07 2007 : Good CMS (Drupal) designers are rare: ten points on how to find your perfect designer

update: after some stupid editing of mine, I brought the points down to six. thanks to Bert for telling me I am fool.

More and more often I have to cope with designers in the process of creating Drupal sites. That is a good sign: Drupal matures, so it gets used in more multitalented, professional environments. Not just a pimpled student in the attic who knows some Photoshop and some Javascript and learns some PHP, but project cycles with multidiscplinary teams involved.