Rockin' JAX with Hashrocket

written about 2 months ago |
0 comments

Hashrocket recently honored Joe Ferris (no relation) and I by an invitation to come down to Jacksonville Beach, Florida to work on one of their 321 Launch projects as guest star programmers.

Chris O’Sullivan actually did an amazingly accurate job of describing the project from a technical point of view by doing an impressively detailed analysis of our github commits and tweets.

We had a lot of things going for us in this project: The clients were a breeze to work with; Desi and Lark were both great developers, and a lot of fun to pair with; and the end product, Spot.us was going open-source – meaning there was no room for “cowboy antics” (Desi’s words).

The client was very impressed with the progress we had made, and with the overall polish of the site. You can read more about the reaction here, and the demo video is below.

Working at Hashrocket was a lot of fun, and in many ways was the perfect vacation. You’re surrounded by talented coders (which fends off the normal vacation boredom), and you get to wake up to beautiful beach views every morning.

Mememe

written about 3 months ago |
1 comment

  • Take a picture of yourself right now.
  • Don’t change your clothes, don’t fix your hair…just take a picture. (should be super-easy with Photobooth)
  • Post that picture with NO editing.
  • Post these instructions with your picture.

(It’s “formal friday”)

Testing named_scope

written about 5 months ago |
0 comments

We’re huge fans of NamedScope here at Thoughtbot. It does wonders for finder reuse and clarity. Unfortunately, it also creates a large number of finders that all must be tested, where the old method may have only created one.

To help out with the testing of simple named_scope definitions, we added a helper to Shoulda, should_have_named_scope:


class User < ActiveRecord::Base
  named_scope :old,      :conditions => "age > 50" 
  named_scope :eighteen, :conditions => { :age => 18 }
  named_scope :recent,   lambda {|count| { :limit => count } }
end

class UserTest < Test::Unit::TestCase
  should_have_named_scope :old,       :conditions => "age > 50" 
  should_have_named_scope :eighteen,  :conditions => { :age => 18 }
  should_have_named_scope 'recent(5)', :limit => 5
  should_have_named_scope 'recent(1)', :limit => 1
end

Now for complex methods, where the options returned by the has_finder are hairier than a simple limit or a single column condition, we would also write black box tests. But this helper is great for those simpler calls.

Quick vim svn blame snippet

written about 6 months ago |
5 comments

Just to prove the theory that every incredibly incomprehensible piece of code you come across is probably your own, I penned a quick svn blame vim command.


vmap gl :<C-U>!svn blame <C-R>=expand("%:p") <CR> \| sed -n <C-R>=line("'<") <CR>,<C-R>=line("'>") <CR>p <CR>

Just highlight the disgusting code in question, and bask in your own shame!

Getting back into the swing of things.

written about 8 months ago |
2 comments

The past three weeks have been a total whirlwind of excitement, glamour, drinking, more glamour, sickness, boredom, and a bit more glamour.

I gave a presentation on BDD with shoulda for Mountain West Ruby Conf in Salt Lake City (video above).

It must be nice to live in a city completely surrounded by gorgeous snow capped mountains. And the library where the conference was held was an incredible example of architecture. Lots of sweeping curves and generous amounts of glass.

After that, it was off to present at Scotland on Rails. I’ve never been to a city as thoroughly beautiful as Edinburgh. It seemed like every street was lined with buildings older than my own country.

I’ll be putting the shots I took for both of these trips up on my flickr account as soon as I have time to unload them.

Unfortunately, I fell under the grips of a serious cold at the end of that trip, and just finished recovering last weekend. So now it’s time to get back up to speed.

I’ll be in New York next weekend for GoRuCo, Brisbane on the 9th for some personal time, San Diego on the 23rd for more of the same, Portland on the 29th for RailsConf, and Portland again in July for OSCON, where I’ll be giving a 3 hour tutorial on advanced ruby metaprogramming.

In fact, I’ve got so many trips planned this season, that I’ve started using Dopplr to keep track of them. Check out my profile and itinerary in the sidebar, stage left.

And I promise to get back to more technical posts as soon as the dust settles.

Email your Backpack GTD items

written about 9 months ago |
0 comments

Like most kids out there, I’m a follower of the GTD system. I’ve gone through a bunch of GTD software and have boiled it down to a combination of Backpack and a pad of paper in my hip pocket.

I thought I’d share a script I wrote that emails me my list of todo items every morning.

First off, my backpack GTD system is pretty straight forward:

  1. A page for each context, the names of which start with ’@’ – so @work, @phone, @online, @zipcar, @home, @blog, etc.
  2. Each context page includes a single list named “Tasks”

That’s about it. I’ve also got a someday/maybe page, and a page for each major project, but those don’t get emailed to me.

Download this script, change the constants at the top, and plop it on a server somewhere. You should test it on the server it will live on by running /usr/local/bin/ruby /home/tsaleh/bin/email_todos.rb

Then setup your crontab to run that sucker every morning. My crontab looks like this:


@daily /usr/local/bin/ruby /home/tsaleh/bin/email_todos.rb 

That should be it. The next morning you’ll get a list of the tasks you have to complete for each context.

Politiquotes - Who said what, when, and where

written 10 months ago
0 comments

Shoulda 4.0.1 - the lean and mean release

written 10 months ago
0 comments

Upcoming conferences

written 10 months ago
0 comments

Rails Rumours

written 11 months ago
1 comment

Elephants

written 11 months ago
0 comments

Switchpipe

written 11 months ago
0 comments

37 Signals introduces line breaks

written 11 months ago
0 comments

A couple of small, but totally useful plugins

written 11 months ago
0 comments

Rescuing Net::HTTP exceptions

written 11 months ago
4 comments

Shoulda in Advanced Rails Recipes

written about 1 year ago
0 comments

Version Control and “the 80%”

written about 1 year ago
0 comments

Book Review: Troubleshooting Ruby Processes by Philippe Hanrigou

written about 1 year ago
0 comments

Almost Painless Nested Resources

written about 1 year ago
0 comments

Remember your MVCs

written about 1 year ago
0 comments

RubyEast '07

written about 1 year ago
0 comments

My Second Markup & Style Meeting

written about 1 year ago
0 comments

Serving 138 Emails a Second

written about 1 year ago
0 comments

Ruby East

written about 1 year ago
0 comments

Moved to Mephisto

written about 1 year ago
0 comments

Trunk Mephisto, Edge Rails, Piston, and Mongrel. Oh, My.

written about 1 year ago
0 comments

Time may be money, but so is morale

written about 1 year ago
1 comment

Brittle Tests

written about 1 year ago
0 comments

Shoulda news

written about 1 year ago
0 comments

Programming as fate

written about 1 year ago
0 comments

Specin rSpec with Rails

written about 1 year ago
0 comments

Shoulda gets busy with your controllers

written about 1 year ago
0 comments

Introducing the Shoulda Testing Plugin

written about 1 year ago
0 comments

It's the little things...

written about 1 year ago
0 comments

Highrise to LDAP Gateway

written about 1 year ago
1 comment

cruise_control.rb campfire plugin

written about 1 year ago
0 comments

And then there was...

written about 1 year ago
0 comments

Campfire API Where Art Thou?

written about 1 year ago
2 comments

Presenting at RailsConf 2007

written about 1 year ago
0 comments

And apparently...

written about 1 year ago
0 comments

ActiveResource from javascript

written about 1 year ago
0 comments

Memories...

written about 1 year ago
0 comments

Battle over testing strategies over at thoughtbot

written about 1 year ago
0 comments

Ennui

written about 1 year ago
1 comment

First rails patch!

written about 1 year ago
6 comments

Quick snippet to add to the top of your environment.rb file

written about 1 year ago
0 comments

LDAP Server for ActiveRecord Models

written about 1 year ago
0 comments

Mocking a network resource with camping

written about 1 year ago
0 comments

Yay!

written about 1 year ago
0 comments

Second refactoring of security roles

written about 1 year ago
0 comments

I heart Ruby

written over 2 years ago
0 comments

Hyperlinks to specific emails in other applications.

written over 2 years ago
0 comments

LDAP Server for ActiveRecord Models

written over 2 years ago
2 comments

Thread safety in Rails and ActiveRecord

written over 2 years ago
2 comments

Using wrapper classes with ActiveRecord to enforce security rules

written over 2 years ago
0 comments

heh...

written over 2 years ago
0 comments

Am I crazy?

written over 2 years ago
0 comments

I had no idea...

written over 2 years ago
0 comments

Command line utility to interrogate models

written over 2 years ago
0 comments

acts_as_graph

written over 2 years ago
1 comment

Now, don't be hatin'

written over 2 years ago
1 comment

migration data dumper on rubyforge

written over 2 years ago
0 comments

Migration Data Dumper Plugin

written over 2 years ago
0 comments

Someone snarfed my plugin!

written over 2 years ago
0 comments

Migration data dumper plugin

written over 2 years ago
0 comments

Helloooo!

written over 2 years ago
0 comments