They don’t make things like they used to

Last year, I stayed with a friend in north Austin during SXSW. A bike was the best way to make the three-mile journey downtown. I had a few options:

  • Renting I called Bicycle Sport Shop and a couple other stores. The problem is that people rent bicycles as entertainment, not transportation, and they’re priced accordingly. At $30 a day to start, that’s more than a car. A 10-day rental would have cost $210.
  • Yellow Bike The Austin yellow bike project was in the middle of a move, and most of their bikes were in storage.
  • Shipping my bike both ways — UPS or FedEx ground — would have run me about $80.
  • Buying a bike The cheapest thing to do was to buy a bike. Academy had some cheap mountain bikes. Target’s were a bit cheaper. I ended up with a Magna Glacier.

I always wondered who bought those department-store bikes.

All was fine for a couple of days. Then: boom. The chain breaks, gets caught in the rear wheel and causes the bike to fishtail. I go down. Hard. I tore my new jeans and ripped a gash in my arm. Oops.

That turned out to be a very expensive “cheap” bicycle.

Check out what happened. The chain was so poorly made, that the metal itself bent and buckled:

Last year, I bought my own snowboarding gear. I snagged a great deal on the board from REI and picked up the bindings from Sports Basement. Since the prices were so good, I upgraded from EX to RX bindings.

Ride’s RX bindings are a step up from their EX model, which is a step up from the LX model. Got that? With an MSRP of over $200, this isn’t the bottom of their line.

Then why, Ride, would you use a plastic release?

Think your airline joining Star Alliance helps you?

Last fall, Continental Airlines joined Star Alliance.

Since I have most of my points/miles with Air Canada’s Aeroplan—also a member of Star Alliance—I thought that would be good news.

It’s not.

There’s no way to combine points from both programs to get an award, and no way to move points from from one Star Alliance partner to another.

When to buy a refurbished Mac

No, I’m not going to tell you when during the year to buy a Mac (“not the week before WWDC”), but I am going to share a neat trick. Tragedy of the commons, here we go.

Apple’s online store has refurbished Macs for sale. These are often a very good deal — today’s selections range from 13-26% off the original prices.

Refurbished Macs carry the same full one-year warranty as new ones and are eligible for the free printer rebate and AppleCare. (Aside: if you don’t need the support, your credit card’s extended warranty protection many be enough.)

But if you look right now, there’s only one refurbished MacBook:

No, Apple hasn’t sold every refurbished MacBook they own. They’re only sold out for today.

If you check back at 1 AM PDT (4 AM EDT), you’ll see a much larger selection. (Didn’t see much? Try again the next day.)

This means by the time the west coast wakes up, the east coast early birds have snapped up the best deals. Suggestion: stay up late.

Handling Rails errors: custom error pages, logging, notification

I wanted to improve error handling In my Rails applications. Specifically, I wanted three things:

  • a custom error page that matched the site's design
  • the errors to appear in the error log (production.log)
  • email notification of server errors

Note: these steps are for Rails 2.3.2–2.3.8. Other versions may require different instructions.

Custom error page

Normally, when server error occurs, Rails renders public/500.html. You can customize this. However, if you include your site's layout information here, you violate the DRY principle.

  1. Create a directory for error templates mkdir app/views/errors
  2. Create the error file: touch app/views/errors/500.html.erb
  3. Remove the static file: rm public/500.html
  4. In application_controller.rb, override render_optional_error_file:
    protected def render_optional_error_file(status_code) render :template => "errors/500", :status => 500, :layout => 'application' end
  5. To test your error handler in the development environment, in application_controller.rb, add this line: alias_method :rescue_action_locally, :rescue_action_in_public be sure to comment this out when you're done, so you can see backtraces.

Logging errors

Because we overrode render_optional_error_file instead of using rescue_from (2), errors still go to the log (production.log).

Email notification

There's a terrific exception notification plugin that handles this for you.

This is a bit confusing, because there are three versions of the plugin floating around:

  1. The master version on github, for Rails 3
  2. A branch on github, for Rails 2.3
  3. The old version, which also works with Rails 2

Important If you install via the standard method (script/plugin install), you'll get an old version of the plugin, and the current instructions (on github) won't work. (See below for legacy instructions.)

If you install from github, you'll get a version for Rails 3 by default, and that won't work, either.

Here's what to do:

  1. Install the plugin from the 2-3-stable branch from github: script/plugin install git://github.com/rails/exception_notification.git -r 2-3-stable
  2. In application_controller.rb, place this at the top: include ExceptionNotification::Notifiable
  3. In environment.rb, add these lines at the very end, after the |config| block:
    ExceptionNotification::Notifier.exception_recipients = %w([email protected]) ExceptionNotification::Notifier.sender_address = %("Application Error" <[email protected]>) ExceptionNotification::Notifier.email_prefix = "[Fancy App] "
  4. To have sendmail send email (instead of using raw SMTP), add this line to environment.rb: ActionMailer::Base.delivery_method = :sendmail

Legacy exception_notification instructions

  1. Install the plugin: script/plugin install exception_notification
  2. In application_controller.rb, place this at the top: include ExceptionNotifiable
  3. In environment.rb, add these lines at the very end, after the |config| block:
    ExceptionNotifier.exception_recipients = %w([email protected]) ExceptionNotifier.sender_address = %("Application Error" <[email protected]>) ExceptionNotifier.email_prefix = "[Fancy App] "

Bikes on a plane

When I went to New Zealand last year, I decided to take my bike with me. I’d have a van the whole time, so moving it around with me would be easy. And Air New Zealand allowed me two free bags, one of which could be a bicycle.

If you’re interested in travelling with your bicycles, here’s what it will cost you:

Packing the bicycle

Before you can take your bike on a plane, you need to pack it in a bike box. Almost any bike shop will give you one of these for free. There are many YouTube videos teaching you how to box up your bicycle.

Aside: If you have an expensive bike or are planning to travel with your bike a lot, it’s worth investing in a hard case.

If you don’t want to pack the bike yourself, you can pay a bike shop to do this for you.

Bike shops in San Francisco

I called many of the bike shops in San Francisco. Here’s what they charge to box up a bike, sorted by price:

Shop Price
Warm Planet BIkes $35-40
Sports Basement $45 ($30-60)
Valencia Cyclery $45
The Freewheel $50
Lombardi Sports $50
Pacific Bicycle $50
REI $60
Box Dog Bikes $70
American Cyclery $70–85
Performance Bike $100
Mike’s Bikes $100
Mission Bicycle Company
Pedal Revolution
Roaring Mouse

I’m not sure what Mike’s and Performance do for $100. Maybe they use gold tape on the box.

Bike shops in Auckland

Here’s what the bike shops in Auckland charge:

Shop Price (NZD) USD equivalent
Bike Barn $35–40 $25–28
Hedgehog Bikes $40–50 $28-36

Airlines

Once your bike is all packed up, the airline may charge you another fee to accept the bicycle as a checked bag. This table’s sorted by airline name:

Airline Fee Notes
Canada Air Canada $50
New Zealand Air New Zealand free
USA AirTran $79
USA Alaska/Horizon free
USA American Airlines $100 2
USA Continental $100 2
USA Delta $200
USA Frontier $50 2
USA Hawaiian $100 3
USA JetBlue $50 2
USA Midwest $50
Australia Qantas free
USA Spirit $75
USA US Air $100 2
USA United $100
Australia V Australia free
USA Virgin America $50
UK Virgin Atlantic free
New Zealand Australia Virgin Blue/Pacific Blue $20 1
Canada WestJet free

Notes

[1] Included in your standard (paid) baggage allowance (cost is $20)
[2] Small bikes (measuring under 62 “dimensional” or “linear” inches) are free (included in your baggage allowance)
[3] $35 for flights within Hawaii

What Mark Fiore is doing with his Pulitzer Prize money

Newly minted Pulitzer Prize winner Mark Fiore — whose app is now in the iTunes Store — had this to say:

Since winning the prize brought attention to Apple’s policy of rejecting iPhone apps that “ridicule public figures” I figure the least I can do is devote more resources to ridiculing public figures.”

More app store hypocrisy

Earlier this year, the nuns on Cupertino’s app store approval team removed 5000 applications for having sexual content. Fine. Be a prude. But what makes this funny is that Apple’s left hand doesn’t know what its right hand is doing: the music store will sell you D12’s Nasty Mind, which contains lyrical gems such as this:

Hoe you can quote this – your breath is smellin like
you done sucked a senior citizen’s old dick in goat spit (god damn!)

It’s one thing to be a prude. It’s another thing to be a homophobic prude. How are eight different apps for locating strip clubs is okay, but a a gay sightseeing guide isn’t?