November 2011
1 post
2 tags
Get your Cape on
Over Thanksgiving Day weekend I released a new RubyGem called Cape. You may find it useful if you’re a user of both Capistrano and Rake. Install Cape by typing gem install cape at the command line, or make it a dependency of your project by using Bundler. What can Cape do? Mirror Rake tasks as Capistrano recipes, optionally filtered by namespace or name Embed Rake tasks in a...
Nov 28th
September 2011
1 post
2 tags
Taking out the trash: disposing of C♯ objects that...
My wife speaks of two kinds of trash: “clean” trash and “dirty” trash. This is not a distinction I consciously would have made without being married to her, but I recognize how useful the categories are. “Clean” trash (non-recyclable plastic and the like) can wait till morning for me to haul it outside and the city to pick it up, whereas “dirty”...
Sep 6th
11 notes
April 2011
1 post
3 tags
Rebasing tags in Git repositories
UPDATE: I didn’t realize that git-filter-branch(1) has the option built in: --tag-name-filter. The moral of the story is: RTFM to avoid writing unnecessary code. :-/ Perhaps you’ve noticed commits in your Git repository that you or a team member created with the wrong credentials. Perhaps you see personal email addresses instead of corporate email addresses among the commit authors....
Apr 7th
November 2010
1 post
2 tags
Vanquish ghoulish bit rot in Ruby source code with...
UPDATE: I used htty as an example project in this post, but its use of Bundler has since changed. Because htty is a gem, its dependencies are now defined in htty.gemspec, along with all htty’s other RubyGems metadata. Application projects (such as Rails applications) should use the techniques described in this post; RubyGems projects should not. To understand why, read Yehuda Katz’s...
Nov 11th
September 2010
2 posts
2 tags
‘htty’ v1.1 is now available
Since its release three weeks ago, lots of people have started using my console application for HTTP called htty. It’s been called the perfect tool for exploring web services. Install it with one command. You’ll need Ruby and RubyGems. It’s known to work well under OS X against Ruby v1.8.7 and v1.9.2. There’s a new version out today. What’s new? HTTP Secure...
Sep 29th
2 notes
2 tags
Introducing ‘htty’, the HTTP TTY
I’ve been hacking instead of writing during my spare time the last couple months. The result is a streamlined console application for exploring web services and web sites. It’s something of a cross between curl and the Lynx browser. Installation It couldn’t be much easier. You’ll need Ruby and RubyGems. It’s known to work well under OS X against Ruby v1.8.7 and...
Sep 6th
39 notes
May 2010
2 posts
3 tags
Never declare another C♯ delegate again
I recently did some refactoring of our .NET Compact Framework codebase. The goal was to tighten up our use of delegates a bit. In case you didn’t know, there’s never a need to declare custom delegates in C♯ code. By way of a quick review, delegates are C♯’s strongly-typed function pointers. Closures, callbacks, and events are all implemented using delegates. The delegate...
May 26th
3 tags
A quick ’n’ clean jQuery plugin for measuring...
The tasty morsel of the day is a simple jQuery plugin. It makes suggestions to the user for how to strengthen a weak password. For the purposes of this example, strong passwords contain characters in all of four categories: capital letters, lower case letters, numerals, and punctuation characters. Several jQuery and JavaScript best practices are in evidence here. It’s written using only...
May 13th
2 tags
Throw a wrench in the works
Programmers who come to Ruby from other languages — particularly C++, C♯ or Java — tend to misuse Ruby’s throw statement. They type throw when they mean to type raise. What’s the difference? Like C++, C♯ and Java, Ruby has first-class support for exceptions. Exceptions can be thrown using the raise statement and caught using the rescue keyword. Rubyists often speak of...
May 1st