Subscribe to RSS

Category Archives: Features

Using Iconv to convert UTF-8 to ASCII (on Linux)

There are situations where you want to remove all the UTF-8 goodness from a string (mostly because of legacy systems you’re working with). Now, this is rather easy to do. I’ll give you an example:
çéß
Should be converted to
cess
On my mac, I can simply use the following snippet to convert the string:

s = "çéß"
s = Iconv.iconv(’ascii//translit’, [...]

Clear DNS Cache on your router

I currently have a Linksys router at home that has the DD-WRT Firmware on it. I’ve been using it for quite some time now, and I’m very happy with it.
In my previous post I mentioned there was some trouble with DNS for Ariejan.net. I’ve changed nameservers and there’s always something that goes wrong.
Anyway, my router [...]

How to write a Rails Plugin (for controllers)

A few days back I posted my very first Rails plugin, Acts As Exportable. Although writing a plugin is rather easy, you must know a few tricks on how to get things going.
This article will show you how to develop a plugin that adds functionality to a controller (other plugins, e.g. for models) will follow [...]

How to resolve Subversion Conflicts

If there’s more than one person working on a project, chances are (although slim) that at some point two developers work on the same piece of code and check it in. To clarify, let me give you an example.
The repository is currently at revision 5 and contains a file named ‘README’. Revision 5 of that [...]

How to create and apply a patch with Subversion

It’s been a while since I posted something new on the use of Subversion. I’ve been working with the tool a lot, and I’ve found that patches are a great way to communicate code changes.
For those of you who are still learning, let me first explain what a patch is. A patch is a text [...]

How to force data to be downloaded as a file from your Rails app

In the essence of every application is data. One way or another your application manages data and at some point, you need to get that data out. Either you want to synchronize the data with another application or device. Or you want to move your data to another system all together. Either way, you’ll need [...]

ActiveScaffold + acts_as_taggable + Auto Complete

I’ve talked before on how to use ActiveScaffold with acts_as_taggable_on_steroids.
The problem with that solution was that, although the checkboxes for every tag are very nice, you couldn’t easily add new tags. For some people, this may be fine, for others, it is not.
Together with a colleague (who wishes not to be named), I found a [...]

Rails production server setup and deployment on Ubuntu/Debian

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 [...]

Action Mailer: All mail comes from MAILER DAEMON

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)
[...]

BASH your SVN and Trac installation!

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 [...]