May 2012
1 post
OSH Park - PCB ordering has never been so easy.
Back at the end of January, when I first agreed to build oshpark.com for Laen I had no idea that I would spend the middle week of May cramming to squash the last of the user facing bugs before a big launch at Maker Faire.  So what is OSH Park? OSH Park is your go-to site when it comes to fabrication of prototype circuit boards. Over the last couple of years Laen has built a reputation for...
May 20th
April 2012
2 posts
4 tags
Meteoric thoughts →
So, thanks to Peter Cooper’s excellent JavaScript Weekly I read about Meteor, which is a pretty interesting new JavaScript framework which seriously blurs the lines between server and client. Meteor is built on top of node.js with some interesting ideas: hot code push: the server seemlessly pushes code updates to all active browser clients when the developer changes anything in the...
Apr 15th
WatchWatch
I threw together a quick video demonstrating how to get instant spec feedback on your code changes right in your editor - brilliant for those of us who test-drive our code. Used in this Video is: Vim 7.3 (actually, MacVim’s binary in a terminal). conque 2.3 - allows running interactive console apps in a vim buffer. cmdalias.vim - nicely manages vim command aliases so that they...
Apr 2nd
1 note
December 2011
2 posts
Serving Ember.js with Rails 3.1's asset pipeline
Last week I spent some time modifying Kisko Labs’ sproutcore-rails gem to use the latest build of Ember.js. emberjs-rails is a fairly simple wrapper that add’s support for serving Handlebars templates from the asset pipeline using a hjs file extension. It also serves Ember’s html5 boilerplate template as a layout called ember.  Here’s a quick run through: First, start with...
Dec 25th
Properly validating email addresses.
There seems to be a lot of chit chat in the rails world about correctly validating email addresses.  The main problem is the compromise between speed and correctness, observe: The examples above illustrate the possible methods of email validation ranging from pathetic to extreme.  Given the average response speed of DNS, I think it’s legitimate to attempt a DNS lookup of the addresses...
Dec 18th
August 2011
1 post
"no reply": it's just not cricket
You know what I’m talking about. Businesses all over the world send out emails, whether they’re some sort of notification, invoice or marketing communication and they disallow direct replies, either by explicitly asking you not to or using a dead-end email address such as “no-reply@idontvaluemycustomers.com”. This totally disrespects your customer, and devalues their time....
Aug 28th
May 2011
1 post
Doing AVR development on a Mac?
Yeah, I know. The Arduino development environment is quite limiting - especially if you are using an AVR chip that is not supported or you don’t have room for the bootloader in your project. Something you might not have realised is that the Arduino environment comes with all the development tools needed (avr-gcc, etc) needed to build and burn firmwares for a large number of AVR based MCUs....
May 3rd
February 2011
1 post
axe.io: Welcome to axe.io →
axeio: Here’s the thing; I’m in this band, and due to the terrible prog rock nature of this band I needed more control over my tone than I was able to get just from my amplifier, so I invested in an iRig and a copy of Amplitube for iPhone. I was blown away by the quality of simulation available on…
Feb 24th
1 note
December 2010
1 post
Dec 6th
November 2010
3 posts
Serve GridFS files directly from rack.
Kimono is using Carrierwave to handle image attachments and save them into GridFS - MongoDB’s built-in filesystem.  GridFS is great because you get the benefits of MongoDB’s replication and sharding.  Putting files into GridFS is pretty straight forward, and I won’t waste time getting into that here, Jeremy Weiland has written an excellent post on using Rails 3, Carrierwave and...
Nov 25th
Start and stop Delayed::Workers with daemonizer
Delayed::Job comes out of the box with a startup script that relies on the daemons gem. to start and stop worker processes.  Problem is, I’ve never actually had it work. After browsing around my options I decided to give daemonizer a go.  The main advantage I saw to daemonizer is that you simply define a single “Daemonfile” in your project’s root (similar to a Gemfile or...
Nov 7th
Automatic rebuild of HAML and SASS.
I love HAML. I love SASS. They’ve both saved me a heap of time writing view code in Rails, but what if you’re throwing together some static HTML and CSS to mock out an interface?  This is where the Travis Tilley’s excellent file system state monitor gem comes in: Boom!
Nov 4th
October 2010
1 post
Patch Rails3 route helpers to use STI base class.
If you’ve perused the source of any moderately complicated Rails application you are likely to have come across the Single Table Inheritance (STI) pattern.  STI allows you to have polymorphic models all stored in the same table or collection. It may be best to give you an example: As you can see from the example, we have three models, Meat, Bacon and ChunkyBacon all using the...
Oct 10th
September 2010
1 post
Dynamic finders for Mongoid →
I’ve been busy over the last while switching a Rails 3 application over from ActiveRecord to Mongoid. In a lot of ways it has gone a lot less painfully than I expected, however one of the main problems I ran into was the common use of dynamic finders in controllers: Mongoid (at the time of this writing) doesn’t officially support dynamic finders, so I have done one of my...
Sep 19th
July 2010
2 posts
Our Rails3 Presentation from Barcamp Auckland 4. →
Jul 27th
Jul 27th