Bob Nadler, Jr. Bob Nadler, Jr.

Don't miss a post! Subscribe to my mailing list.

No spam, ever. Unsubscribe at any time.

Turn a Ruby Array into a Hash

Published over 11 years ago less than 1 min read

I always forget the syntax for this:

ary = [:a, 1, :b, 2, :c, 3]
Hash[*ary] # => { :a => 1, :b => 2, :c => 3 }
Read more →
Danger: Carnivorous Pigeons

sed in-place editing gotcha in OS X

Published over 11 years ago less than 1 min read

I just started learning about sed and came across one "gotcha" when using the -i option in OS X. The -i option allows you to edit a file in-place. It takes an optional parameter - a string to use as the extension for the backup file. If this parameter...

Read more →
Sugar Loops

Syntax Sugar for Defining Test Helper Methods

Published over 11 years ago 1 min read

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

Read more →
LinkedIn Chocolates

LinkedIn API and Sinatra

Published over 12 years ago less than 1 min read

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

Read more →

Autogenerate ctags for Ruby Gems

Published over 12 years ago less than 1 min read

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.

Read more →

Find Method Usages with ctags and vim

Published over 12 years ago less than 1 min read

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`/../* .
Read more →

Sidestep: Mobile Web App with jQTouch

Published over 12 years ago less than 1 min read

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.

Read more →

7 Tips for Writing User Stories

Published almost 13 years ago less than 1 min read
  1. Pick a format and stick to it. I prefer "As a <role> I want to <goal> so that <benefit>."
  2. Be sure to include acceptance tests with the story.
  3. Keep technology terms / phrases out; a story should define user interaction absent of technology.
  4. Have your...
Read more →

JavaScript Patterns: Revealing Module

Published about 13 years ago less than 1 min read

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:...

Read more →

Side Project: Car Fuel MPG Tracker Using Sinatra

Published about 13 years ago less than 1 min read

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

Read more →