GNU Screen and my screenrc

GNU Screen is a remote terminal multiplexer, described welll elsewhere.

I use it to eliminate the too-many-Terminal-windows problem on my laptop. I also use it to help me achieve some level of continuity on remote hosts, by leaving half-completed sysadmin tasks as-is until hours or days later even if I get interrupted or if the task is really long-running and I need to roam around with my laptop.

Today I decided to invest some time in making my command-line development environment launch with a single script. Here are the details.
Continue reading “GNU Screen and my screenrc”

Non-persistent Rails model classes, for easier validation

I’ve been fighting for a couple of days to learn how to best use Rails’ form validation on forms that don’t map cleanly to database tables. I think I’ve got it. The trick appears to be to use non-persistent model classes, that nonetheless inherit from ActiveRecord::Base. Here’s how.
Continue reading “Non-persistent Rails model classes, for easier validation”

First Rails gotcha: Rails doesn’t tear down fixture data

Rails doesn’t delete loaded fixtures in the tear down phase of tests, but it does delete and re-insert the fixtures you do use at the beginning of tests. This is a serious problem if you use foreign keys.

This issue is covered in the Rails issue tracker here: http://dev.rubyonrails.org/ticket/2404
Continue reading “First Rails gotcha: Rails doesn’t tear down fixture data”

Prefactoring

I have a text file full of links and notes extracted from about a month of reading everything posted to the 2 dozen Ruby, Rails, Postgres, and web tech blogs that I subscribe to via RSS. There’s so much going on in Ruby and Rails in particular, especially when it comes to convenient shortcuts that save you work, that there’s something new and cool and slightly revolutionary on a daily basis that you could use to make your app prettier.

So I’ve been in a state of analysis paralysis for about a week.

I was trying so hard to be clever and state of the art that I forgot to get something working.
Continue reading “Prefactoring”