ES6 style hash literals in Ruby (Or how to create a naughty fork of Ruby on your own machine) I've been writing a lot of JavaScript code lately, and one pattern I see used a lot is something that I think is called an Object Literal. The idea behind this
Make a Heroku style spinner in Ruby If you've been using the Heroku command line toolbelt lately you would've noticed the cool progress spinner they have when you're running a task: (It's the swirly thing on the right hand side - it actually looks better in real life, but I did
Scaling support emails When Lexoo was just starting out, support was simple. We didn't have many customers so could look after all the support problems ourselves. As we got more customers we decided the best way of making sure no support ticket was missed was by CCing
Automating NPS with the promoter.io API If you want to find out more about NPS then check out my previous blog post How much do your customers love you? Every Tuesday morning I send out an
How much do your customers love you? NPS stands for Net Promoter Score. It's the hot new metric that seems to be taking the startup world by storm. But...what is it? And how do you collect
Custom alerts for naughty visitors The other day I discovered something unusual: according to our analytics we had 74 visitors to lexoo.co.uk from a link on elance.com (a website for finding freelancers)
So, your boss wants to give you equity... You’ve landed a great job at a startup, and your boss has agreed to grant you some equity. Well done for getting a slice of the action! In this article I share some of the basic lingo to do with employee shares, and
Three left turns* Earlier this year I read the book 'The 4 hour work week'. This is a book that I had heartily recommended to a lot of people, but had never read myself. One of the exercises the book makes you do is to write down
Host your own blog? Stuff that. Yep - I've changed my blog. It was about due for a refresher, and this time around I decided to use the amazing Ghost.io. And get this: I've decided not to host it myself. Ghost.io is just too easy not to use.
Use a Google Map as the background of your webpage Ever want to fill up the screen with a Google Map and make it the background? We wanted to do that for the location pages on Lexoo. Here's an example of what I'm talking about: Turns out it's pretty easy to do. Let's say
Add new Objective C subscripting to your own objects The new Objective C literal syntax is a huge leap forward in syntax - especially in terms of accessing arrays and dictionaries using subscripts. Have you ever wanted to add subscripting to your own app? You just need to add some secret methods: Kinda
Task organisation without the ceremony If you're anything like me, you've tried all sorts of systems to organise your life. For me, nothing ever seemed to stick. I would use an online website to record tasks, and find myself stymied when ever I added tasks that didn't quite match
Brainstorming doesn't work The Jan 30 edition of the New Yorker has a fantastic article by Jonah Lehrer about brainstorming. Read it here: GroupThink by Jonah Lehrer (subscription required). The conclusion of the article is quite surprising. Studies show that groups using brainstorming techniques churn out fewer
Auto-refresh a webpage with html I'm currently working on an app that has a dashboard-style page that we needs to be automatically refreshed. After digging around, I realised that the code to do this was ridiculously trivial: UPDATE Frederic in the comments mentioned a way nicer way of doing
How to host a static website on S3 Updated: January 19, 2012 **UPDATE:** I was horribly wrong about how to do the domain forwarding for naked domains - however there's a simple answer. The good folks at [wwizer](http://wwwizer.com/naked-domain-redirect) have got a free naked domain rewriting service. In order
Introducing Big Buttons Here's a video demo of an iPhone app I've been working on called Big Buttons. The idea behind it is that it allows you to control your mac with your phone. I've made a bunch of buttons that do a wide range of things,
Speed up gem installs by not building the docs You know what it's like - you install a gem and are confronted by minutes of this: Installing ri documentation for bananas-0.4.9... Building YARD (yri) index for bananas-0.4.9... Installing RDoc documentation for bananas-0.4.9.. I never look at the
Are your cukes not timing out? Whenever we'd run the full cucumber suite we found that were not timing out if they couldn't find a particular element on the page. For us, the problem was to do with Timecop. You see, we're using Timecop in our features like this: # in
How to make embeddable snippets with Rails Embedding a gist is a doddle - you create the gist, and copy the snippet, and BAM you end up with something like this: I wanted to add this ability to Spoiler Tweet so that people can embed spoilers on their blogs (and also
Get real with your specs, punk In my rspec spec definitions I was finding myself constantly repeating the word “should”. Like: it "should add two numbers together" it "should taste like bananas" And it's not just me that does this, the standard rspec rails generators have “should” in them too:
Gravatar default images - a better way At Harmonypark we decided to put gravatars into one of our applications (which is so easy it’s not funny) – and when the time came to select the default images for the gravatar I piped up: “I know how to fix this!” and pointed
What columns does an ActiveRecord model have? Something that bugs me about using ActiveRecord models is that I have to look in schema.rb file to remember what columns a model has. Enter…What Column! This is a little plugin I bunged together on the (long) train journey home from
Refactor away your comments Last week I had the good fortune of having my colleague Abdel Saleh go through some rspec specs I had written. “Why do you need this comment?” he asked for a bit of code like this: before(:all) do # Ensure doesn't actually
Prefer Guard Clauses over nested conditionals Ever find yourself wrapping a method with a conditional: def save_to_file(filename) unless filename.blank? do_something do_something_else end end Or maybe you subscribe to the one exit from a method strategy. I write code that looks like this a
Localizing your Rails application I wrote a better version of this article for the Ruby Advent 2008 site. Find it here: http://advent2008.hackruby.com/past/2008/12/16/rails_22_internationalization/ Recently I discovered that most of the visitors to one of my apps (What I want