Don't miss a post! Subscribe to my mailing list.
Syntax Sugar for Defining Test Helper Methods
I prefer Ruby's Test::Unit
over RSpec, but one of the things I like about RSpec is the let method. It allows you to create memoized helper methods in your tests. When I use Test::Unit, I usually mimic this behavior using a private helper method. Today...
LinkedIn API and Sinatra
I've been playing around with the LinkedIn API and Sinatra for about a week and wrote a tiny app. After you authenticate using your LinkedIn credentials, the app allows you to search your connections for those that have a skill you specify. The source...
Autogenerate ctags for Ruby Gems
I already mentioned in a previous post how to generate ctags for a Rails app. You can also use the gem-browse and gem-ctags gems to automatically generate a ctags file every time you install a new gem.
Find Method Usages with ctags and vim
I always forget how to set up ctags for a Ruby/Rails app so that I get tags for not only the project, but also any gems specified in my Gemfile. From the project root do:
ctags -R `bundle show rails`/../* .
Sidestep: Mobile Web App with jQTouch
Sidestep is an experiement built using Sinatra and jQTouch. It's a mobile web app that provides NJTransit train information. The source code is available on GitHub.
7 Tips for Writing User Stories
- Pick a format and stick to it. I prefer "As a <role> I want to <goal> so that <benefit>."
- Be sure to include acceptance tests with the story.
- Keep technology terms / phrases out; a story should define user interaction absent of technology.
- Have your...
JavaScript Patterns: Revealing Module
Awhile ago I wrote about the Module Pattern in JavaScript. There is an alternative that is quite popular called the Revealing Module Pattern that looks like this:
The problem is, I don't like it. My main issue with this pattern is readability:...
Side Project: Car Fuel MPG Tracker Using Sinatra
Update: Looks like ZeepMobile has shut down so the example app is no longer up. I've kept the repository though.
I was playing around with Sinatra a few months ago and decided to create a small app with it. It's a very basic online fuel efficiency...
Pivot Tables in SQL
Sometimes when trying to pivot a large dataset it makes more sense to perform the pivot in SQL rather than using something like Ruport. I always forget how to do this so here's a reminder.
Spellbook: Rails 3 Application Generator
Spellbook is a Rails 3 application generator that aims to make the tedious parts of setting up a new Rails app trivial. You define various settings in YAML and Spellbook runs through each of them prompting you for your choice. After all your choices...