Bob Nadler, Jr. Bob Nadler, Jr.

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

No spam, ever. Unsubscribe at any time.
Three wise monkeys

The Rule of Three

Published almost 8 years ago 7 min read

If you're not familiar with it, the "Rule of Three" (aka "Three strikes and you refactor") is a guideline attributed to Don Roberts. I first ran across it a few years ago while reading Martin Fowler's Refactoring. Here's the full quote from the book...

Read more →
Driving Technical Change

Driving Technical Change

Published almost 8 years ago 1 min read

I purchased Driving Technical Change by Terrence Ryan as part of a Pragmatic Bookshelf sale a few months ago. Overall I thought it was a good book, though a bit basic. One handy tool I got out of it was the "Skeptic / Technique Matrix". In the book...

Read more →
Night Train

Heroku Slug Compiler Optimizations

Published over 8 years ago 1 min read

Using .slugignore to reduce your slug size

This may be old news to some, but I recently learned about a cool Heroku feature: the .slugignore file.

What is it?

A .slugignore is like a .gitignore file for your app. It is used to reduce the size of...

Read more →
Newly cut

RubyMotion: Clearing Out motion-stump Mocks

Published over 8 years ago less than 1 min read

Update: The pull request mentioned below has been merged and motion-stump clears mocks automatically now, so this after block is no longer necessary.

This one had me "stumped" for awhile. When using motion-stump mocks, you need to clear them in an...

Read more →

Turn a Ruby Array into a Hash

Published almost 9 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 almost 9 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 almost 9 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 almost 10 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 almost 10 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 almost 10 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 →