Archive for June, 2007

AJAX Rules! 80 JavaScript Solutions for professional coding

June 21st, 2007

Smashing Magazine has put together a very comprehensive list of 80 AJAX JavaScript solutions for professional coding. How great is that?!

The list includes solutions for auto-completion, inline editing, menus, tabs, calendars, all sorts of interactive stuff and tables, charts, graphs, forms, grids, lightboxes, galleries, showcases, visual effects and also, some basic JavaScripts that everybody should know about.

Rails production server setup and deployment on Ubuntu/Debian

June 20th, 2007

Please digg this story to spread the word! Thanks!

Okay, this is a big one! This article will show you (and explain to you) how to setup a Ruby on Rails production server with Ubuntu 7.04 or Debian 4.0 and how to deploy your Rails application there.

First, what’s getting installed:

  • Ruby 1.8.5
  • Ruby on Rails 1.2.3
  • Subversion 1.4
  • MySQL 5.x Server
  • Apache 2.2.x
  • Mongrel Cluster

I assume that you have just installed a fresh system with Ubuntu Linux 7.04 or Debian 4.0. If you haven’t, do so now! You don’t need to install the “DNS” or “LAMP” server in Ubuntu. Just a minimal system is enough for this tutorial.

I’ll be deploy an imaginary Rails application named “myapp” which uses MySQL and is stored in Subversion. More on that later on.

Well, let’s get going and get that Ruby on Rails server ready.

Action Mailer: All mail comes from MAILER DAEMON

June 20th, 2007

Today I was trying to send mail from my Rails application through Action Mailer. This is quite simple, but I wanted to use a custom from-address. So, I create a setup_email method in my UserNotifier class that sets some defaults for every email sent out:

class UserNotifier < ActionMailer::Base
  protected
    def setup_email(user)
      @recipients  = "#{user.email}"
      @from        = "My Application <no-reply@example.com">
    end
end</no-reply@example.com">

Geslaagd! / Passed my final exams!

June 19th, 2007

Please scroll down for the English version.

Bij wijze van hoge uitzondering, een post in het Nederlands op mijn weblog! Ik ben vandaag geslaagd voor mijn opleiding Hogere Informatica (aan Fontys Hogeschool ICT, Eindhoven) en mag mezelf nu gediplomeerd Software Engineer noemen!

Ik ben op drie punten beoordeeld:

  • Eindrapport: 7,5 – Ik ben er gewoon niet goed in, maar het is toch nog wat redelijks geworden.
  • Eindpresentatie: 8 – Het ging gewoon lekker
  • Resultaat: 9 – Dit slaat op het werk dat ik heb afgeleverd, mijn inzet, zelfstandigheid etc.

Samen komt dit uit op een eindcijfer 8. Natuurlijk ben ik hier heel trots op, en ga het in ieder geval de rest van de dag vieren!

Feliciteren kan in ‘n commentaartje :P

Read more for the English version

Buy it now! Mac OS X 10.5 Leopard

June 14th, 2007

It appears that Amazon is accepting pre-orders for Apple Mac OS X Version 10.5 Leopard, which is scheduled for release in October 2007.

There are, as usual two version available, Apple Mac OS X Version 10.5 Leopard at $129 for a single license and the Apple Mac OS X Version 10.5 Leopard Family Pack for $199, which includes licenses for up to five Macs in your home.

BASH your SVN and Trac installation!

June 12th, 2007

I’ve already discussed how to install Subversion and Trac on your Ubuntu server. In my case I have a server that manages different SVN and Trac installations for a group of developers.

Creating a new SVN repository and Trac installation every time is quite boring and “if you need to do it more than once, you should automate it”. So, that’s what I did.

ActiveScaffold, Acts_as_taggable_on_steroids

June 11th, 2007

Update: also read Active Scaffold + Acts_as_taggable + Auto Completion.

This is kind of an advanced topic, but I think it may be useful to a lot of people.

ActiveScaffold is a great plugin to start building a user interface. The great thing about AS is, that is automatically recognizes associated models. When editing a model, you can easily add or select another model that you want to associate with is.

The best example of this is an Article, where you can select the author (the associated User model) with a drop down box.

There is only one point where I ran into trouble with ActiveScaffold: acts_as_taggable_on_steroids.

Acts_as_taggable_on_steroids allows you to easily attach tags to models and do all kinds of crazy stuff with them. But, if you want to integrate in into AcitveScaffold, you’re in for a tough ride.

Find and Replace with a MySQL Query

June 10th, 2007

There are times when you have a lot of data in a database (let’s say wp_posts for a Wordpress blog like Ariejan.net). When you need to find and replace certain strings, this can be a very tedious task. Find all posts containing the “needle” string and manually replace all these occurrences with “chocolate”. With about 200 posts, you can imagine how long this would take to do manually.

Send mail with a BASH Shell Script

June 10th, 2007

Like any good programmer, I try to automate the crap out of everything. If you have to do it more than once, I try to write a script for it.

This time I want to show you how you can easily send an e-mail from a BASH script. The idea is that you want the script to send out an email to notify a user that something has happened.

Ultimate List of Ruby Resources

June 10th, 2007

This is the first post, named “Ruby”, in a series of “Ultimate List of … Resources”. I’m going to compose several lists for different topics I encounter during my development work. To start, I begin with Ruby. Later, I will add “Ultimate Lists” about Ruby on Rails, Subversion, AJAX and some other topics.

Feel free to let me know if I missed an important resource. I’m also open to suggestions about other “Ultimate Lists”.

For now, you’ll have to settle for the “Ultimate List of Ruby Resources”.