Adventure Log

03 Jul 2009 » Permalink

I had a heck of a day! I spent the day working out of Carrboro Creative Coworking, which I recommend. I ran into friends there, and knocked out a prototype of an app I've wanted to build for a while.

The cool part is that I used a bunch of technologies I don't normally use. I'm using Haml and Sass, Compass, and MongoDB with MongoMapper. I've had a hate-on for Haml for a while, but I wanted to try Compass, and since I was using that, I thought I might as well try Haml, which is required by Compass. So far, I have lost my hate for it. I'm not up to even strong-like yet, but there's definitely weak-like.

I even made a patch for MongoMapper and sent a pull request. Any day I contribute back to open source is a good day.

02 Jul 2009 » Permalink » View Comments

I wrote a gigantic post about internationalization in Rails for the Viget Extend blog today. Go check it out to see what I've learned about that.

I also learned something simple today. I'm using MongoDB for something, and I wanted it to start up under OS X when I log in. I've created a LaunchDaemon before, but I'd forgotten where to start. Once I found and read this good article on creating your own daemons, it wasn't hard from there. I ended up with:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
 "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
    <key>Label</key>
    <string>org.mongodb</string>
    <key>ProgramArguments</key>
    <array>
        <string>/Users/cnixon/lib/mongodb/bin/mongod</string>
        <string>run</string>
    </array>
    <key>RunAtLoad</key>
    <true/>
</dict>
</plist>

If you drop that under ~/Library/LaunchAgents, you'll be in business.

17 Jun 2009 » Permalink

I started using Typus today on a Rails project for the admin interface. My one-day, fully-unqualified review: badass.

I knocked out my first article in months as well: Analyzing My Knowledge Portfolio.

16 Jun 2009 » Permalink

I wrote an email to a young developer today:

The number one thing you can do is to get involved in an open-source project. Find a project you're interested in - and will use yourself - and start contributing to it. You don't have to contribute code at first. People always need help with documentation. Whatever project you choose, try to choose one with a commitment to test-driven development. You'll learn a lot reading and writing tests.

Know two languages that are kind of far apart. Ruby and Java are good choices. A functional language and an object-oriented language would also be a good mix.

Lastly, there's some great books to read. I think you'll get more out of these after a year or two of professional development, but you can read them now: The Pragmatic Programmer, The Passionate Programmer, and The Productive Programmer. (These aren't in a series, although maybe they should be.) Read them now, and read them again after a year. Reading them each year isn't a bad idea.

I decided to take my own advice. I'm reading The Pragmatic Programmer again. I read the first chapter over dinner tonight, and I might have to slow down. You'd think after reading it twice before, I wouldn't be struck by ideas, but I was.

The first three sections are sort of ingrained by now, and didn't blow me away, although I enjoyed them. The next section, "Good-Enough Software," applied directly to a situation I was in today. I've got a project that's been on and off and it's back on, but has to be done by June 30. That's not a lot of time, and the requirements haven't changed. It's scary. PragProg's tip #7 addresses this: "Make Quality a Requirements Issue."

With the scope unchanged, I have to think about quality. Is this going to be the most polished piece of software? Definitely not. Is it going to be good enough? Yes.

I'll talk about the rest of the chapter tomorrow.

15 Jun 2009 » Permalink » View Comments

I've got this legacy site I'm working on with a CMS-like Rails tool that works like this: you edit page templates and pages through the admin backend, and these page templates and pages are written to disk, not as cached compiled pages, but as views. The page template about would be in app/views/layouts/generated/about.html.erb, for example.

We upgraded to Rails 2.3.2 on this site recently, and the CMS quit working correctly. We could edit the templates, but the rendered HTML stayed the same, even though the template changed on disk. I thought this might be caching somewhere. What I found in the end was this note in the actionpack changelog under 2.2.0:

Do not stat template files in production mode before rendering. You will no longer be able to modify templates in production mode without restarting the server.

So that's not good for this specific use case. (There's reasons its good for other use cases.) I've got to figure out how to selectively work around this tomorrow. I spent a good hour on it today, but got stuck.

22 May 2009 » Permalink

People keep making awesome Rails plugins. Typus is going to be my new friend for making admin interfaces for sites. The concept behind it - "trusted users editing structured content" - sounds a lot like Django's admin application. The roles stuff in it is very nice.

I've been using four different versions of Ruby on my box for a while. I've got apps that need Ruby 1.8.6 and apps that need Ruby 1.8.7, and I like to use Ruby 1.9.1 and JRuby. Mat Brown's multiruby replacement script is the hookup, both for cross-Ruby testing, but also for just getting gems installed without a ton of trouble.

21 May 2009 » Permalink » View Comments

There's a lot of exciting stuff happening with Radiant right now. I've used Radiant on some work projects and felt like it was so-so. Don't get me wrong -- it's a great piece of software, but there were always features that didn't exist or, worse, were unpolished.

The thing that came out today that got me all excited is the Chronicle Extension.

This extension gives you a sweet interface to have versioned pages in Radiant, including the ability to work on a draft version of an already published page.

This cat Aissac is my new hero for his set of extensions:

The video above taught me about Radiant development mode, which I somehow missed before. I also caught a glimpse of the page attachments extension, which I'd be very prone to use if I'm not using the Tiny Paper extension. The page attachments extension has a simple interface that I really like.