Joined June 2011

Chip Castle

Chip Castle Dot Com, Inc.
Santa Rosa Beach, FL

The site is now located at

Hey ianmusc - You might try Cygwin to get you started. Hope that helps.

Posted to Replace conditional with Null Object over 1 year ago

Really nice approach. You can clean up User#price if you do something like this:

class NoSubscription
  def charge

  def price

class User
  include ActiveModel::Model
  attr_accessor :credit_card, :subscription

  def subscription
    @subscription ||

  def charge

  def price

However, I would be careful adding wrapper methods like User#charge and User#price because this tends to lead to God models, especially when working with classes like User, Order, etc.

In general though, your suggestion prevents nil checks and removes conditionals, and that's an excellent improvement!

Cool. I posted a tip similar to this in the past, with some nice suggestions by other devs:

@carwin - Interesting. I think @mislav just posted about that at Nice tip!

@mislav - Great tip! I definitely need to check out your pair command and also gh-auth. Very cool work there. On a related note, I tried tmate this week with a co-worker and it was really easy to use for pairing as well.

Really nice work. Would you mind elaborating on why you check for 'seconds < 45' as opposed to 60?

@tdl - Agreed. I didn't know about the -c option for the uniq command, so thanks for sharing that!

Posted to My Workspace over 1 year ago

You need bigger speakers! ;-)

Posted to Rake task list in Rails over 1 year ago

@slothbear - Good suggestion, as I didn't notice that some tasks were missing. Unfortunately, that didn't work on my system, though (OS X):

☺ rake -T -A db
invalid option: -A
chip@macbook ~/code/project 1.9.3-p194 [master]
☹ rake -V      
rake, version
Posted to Non-destructive Vim piping over 1 year ago

Very nice!

I ran into this before and it took me an embarrassingly long time to figure out. This is really helpful. Nice post!

@larrywilliamson - thanks for the suggestion, since others might run into the same issue. Here's more info in case anyone is interested:

@orangetux, Thanks! You might want to check out Drew Neil's project:

Posted to A Software Architect over 1 year ago

I couldn't have said it better. Great stuff, Chris!

929 Karma
140,850 Total ProTip Views