Archive for October, 2008

Pompe!

Friday, October 31st, 2008

While I was cycling through the Italian speaking bit of Switzerland a few years ago I stopped at a bike shop to inflate my tires.

In that shop I used a pump that so impressed me that I searched it out upon my return to London.

I never did quite get around to buying one but just incase you, dear reader, ever feel the need to buy me a present here it is:

skitched-20081031-213714.png

The wooden handled, brass chucked, leather gasket equipped Superpista is a thing of beauty (don’t even talk to me about the Pista which seems to have swapped a wooden handle for an inferior and environmentally unsound plastic one).

Each part is replaceable, the entire pump is user serviceable.

How cool is this!

http___www.silcapompe.it_instruction-silca_AWVM0155.pdf.png

More than that, the clean and efficient way that the brass chuck attaches to a presta valve is startling and efficient if you come from the modern plastic lever latched world of the modern pump. No levers, no nasty rubber/plastic thing to force onto the valve. This is just a simple combination of leather and brass that you press onto the valve, it fits like a glove. A high quality leather lined brass glove.

Link

Blackboard Specifications

Thursday, October 30th, 2008
DSC00273.JPG-1.png

My clients have a wicked cool blackboard meeting table. We did a quick stand-up domain modelling session today.

Rails Single Table Inheiritance and class loading

Sunday, October 26th, 2008

I might have mentioned this before but you should be very aware of how your development environment loads and caches STI classes.

Update: yeah, I did mention this before.

Say I have:


class Partner
end

class DrivingSchool < Partner
end

class Library < Partner
end

and I want to query

Partner.find_by_partner_code("abcde")

unless the system has previously loaded DrivingSchool and Library it will not query those subtypes.

You’ll get

SELECT * from Partner WHERE type = "Partner" AND partner_code = 'abcde'

rather than

SELECT * from Partner WHERE type = "Partner" OR type = 'DrivingSchool' OR type = 'Library' AND partner_code = 'abcde'

and so those subtypes you want to include don’t come through.

The solution is to add the following to your ApplicationController.


# We're using STI here and it doesn't do a great job of loading up subtypes
# so if the system hasn't yet seen a subtype of Partner and you then query
# on Partner, it won't find subtypes.
require_dependency 'partner'
require_dependency 'library'
require_dependency 'driving_school'

I like the new Macbook

Tuesday, October 14th, 2008

But it isn’t so great that I’m not going to be able to hold off until June when my current Macbook turns 3 years old.

Now I need to send my Macbook back to get the wifi fixed again.

There, I just had to get that off my chest.

Thank you for your understanding.

Add ERB to your ActionMailer fixtures

Friday, October 10th, 2008

Easy:

def read_fixture(action)
  template = ERB.new(
    IO.readlines(
      "#{FIXTURES_PATH}/sms_registrations_mailer/#{action}"
    ).join
  )
  template.result(binding)
end

Now you can <%= %> in your fixture to your heart’s content.

Understanding this credit crunch thing

Wednesday, October 8th, 2008

I’ve been ignoring the news for a bit but wanted to learn more about what’s going on with the “economic crisis”.

Here are a few audio programmes that I’ve found very useful.

The Giant Pool of Money - explains the mortgage backed securities that kicked off this thing

Another Frightening Show About the Economy - explains what’s happened since

Planet Money Podcast - the same reporters have a podcast.

Why are these programmes good? They’re mostly jargon free. They give good, concrete examples of how these mechanisms work at a street level and individual company and bank level.

Oh, and listen to them in that order.

Creaky bottom brackets

Tuesday, October 7th, 2008

Today I visited the Hackney Bike Workshop for the second time. The first time I came away with a slightly improved bike and a promise that they’d have a special tool that I needed when I returned.

The workshop is a help-yourself type place with some very knowledgeable people who wander around giving tips and lending a hand.

I had some help from Paul, thanks Paul, who helped me track down and treat my bike’s particular creak and pop to the bottom bracket.

The process was incremental. First taking off the pedals, cleaning the thread, applying fresh copper grease, and re-installing. No change in the creak/pop.

Then out with the crank bolts. Application of a special crank pulling tool that works with the Shimano octa-link crank/axel combo.

Once the cranks are off you need another pair of special tools (splined?) for unscrewing the bottom bracket cartridge and the matching plug on the other side. Oh, and a fucking massive crescent wrench. 2 feet long! Lots of torque.

Pull out the cartridge / clean and grease the threads with copper grease.

Reinstall everything.

Tighten thoroughly.

Sorted, no more creak/pop. It is very satisfying to be able to fix something like that myself.

So, why bother with the workshop? Why not just go it alone?

Tools: they have lots of them and that saves cash.

Work stands: expensive to own in terms of space and cash, they have lots.

Know how and experience: when you’re applying ludicrous force to a rather expensive and soft aluminium bolt it is very nice to have someone there to reassure you that you’re doing the right thing. They’re as hands-off as possible too, letting you get the feel of things yourself.

They take small donations. Isn’t that nice of them?

Hackney Cyclist’s maintenance workshop

I also recommend Zinn and the Art of Road Bike Maintenance (2nd Edition) - it is damn fine for telling you things like “the right hand side of the bottom bracket has a left hand thread so you turn it the other way to loosen it.

Bottom line, never get reamed by a bike repair workshop again. This stuff is easy and having someone to show you the ropes is a great confidence builder.

Other random notes: they have a barrier cream. If you use that before you start working on stuff then all the grease washes off pretty well at the end. Bring your own band-aids if you have a habit of skinning your knuckles on bike bits when working on them. They seem really good at helping people learn basic preventative maintenance too.

I’ll probably go along most of the time now as I ride enough that my bike is always in need of some sort of servicing. When I leave London and move somewhere that owning your own bike stand is feasible I’ll have the experience and know-how to be a self sufficient cyclist.

Next year I might use the workshop to build a cool-kid single speed / fixie from salvaged parts… if I can find any.

Rails Flash.now

Tuesday, October 7th, 2008

flash[:notice] when redirecting

flash.now[:notice] when rendering

well… learn something new every day.

this will stop your flash lasting one action too long

great write up here:

http://www.rubysavedmylife.com/2007/12/15/flashnotice-vs-flashnownotice/

thanks guy. that’s rad.