Insights on Ruby, Git, jQuery, Cappuccino, WordPress, Debian and OS X. Please subscribe if you find something useful!

Rubular

Posted: December 2nd, 2009 | Author: Jerod | Filed under: Ruby | Comments

Most of the online regular expression testers I’ve used just aren’t that useful, but Rubular is the exception. It uses AJAX appropriately, has a clean aesthetic, and the quick reference at the bottom of the page is so useful it hurts. Plus, it has great features such as match extraction and the ability to create permalinks to your results.

rubular

Rubular is only for Ruby regexes. I wish somebody would make one for JavaScript. Jubular, anyone?


Ad Hoc Command-Line Notifications with Twitter

Posted: November 14th, 2009 | Author: Jerod | Filed under: Ruby, Tools | Tags: | Comments

Have you ever spent way too much time babysitting a long-running command? Code compilation, large file transfers, software upgrades and other time consuming tasks can trash productivity by requiring intermittent attention.

I have a novel idea; let’s not do that anymore!

Read the rest of this entry »


Just Abort It

Posted: August 24th, 2009 | Author: Jerod | Filed under: Ruby | Comments

A lot of people end up writing Ruby methods that looks something like this:

def stop_error(message)
  puts "ERROR: #{message}"
  exit(1)
end

Which they call in their app like so:

stop_error "Oh noes, file doesn't exist!" unless File.exist?(file)

I used to write that method a lot too. Did you know Ruby has a built-in method that provides just what we’re all looking for?

Kernel::abort

So, stop writing your own little method and just abort it:

abort "Oh noes, file doesn't exist!" unless File.exist?(file)

AppStore Ruby Module

Posted: August 22nd, 2009 | Author: Jerod | Filed under: Ruby | Tags: , | Comments

So I was writing my first iPhone on Rails app when my Google Reader dropped some pretty awful news on me. Somebody pre-empted my release with their (pretty excellent, but poorly named) “Bargain Bin with Push!” app (iTunes link).

The Bad News

“Bargain Bin with Push!” does pretty much exactly what my app was going to do. It provides push notifications when apps you’re interested in drop in price. Instead of raging against the dying of the light, I’ve decided to just user their app and let mine go gently into that good night.

The Good News

All was not lost. I learned a ton along the way and decided to open-source the module I was using to fetch app information out of Apple’s App Store.

The Goods

The code is on GitHub, of course. Clone, fork and branch to your heart’s content. Hopefully somebody will find it useful.


Self-Scheduling Ruby Scripts

Posted: August 20th, 2009 | Author: Jerod | Filed under: Ruby | Tags: , | Comments

Whenever is an awesome library that:

“provides a clean ruby syntax for defining messy cron jobs and running them Whenever.”

Whenever has become very popular for use with Rails apps and there are plenty of tutorials on how to use it. This RailsCast is a good place to get started if you’re interested in that.

However, I haven’t seen too many people writing about using the library outside of Rails (or other web frameworks).
Read the rest of this entry »