February 2012
3 posts
Float and backbone.
Live-coding a simple backbone.js app
3 tags
A few live coding tips
Last night at Scotrug I live coded some of ToDoMVC in Backbone.js to introduce Rubyists to Backbone and how it looks & feels.
Since it went surprisingly well, I thought I’d share a few quick tips:
Keep it simple
The todo list app I wrote is very simple (and I didn’t even finish it), but complex enough to demonstrate the basic elements and power of backbone.
The power of live...
January 2012
8 posts
Time is not a nice person, I know because the signs said it.
Time can be...
– Pase Rock
From Sign (feat. Pase Rock) by Nujabes on Modal Soul
Faster rake tasks in Rails
Rake tasks are awesome for project specific scripts among other things, but in rails projects they suck for short tasks that don’t depend on rails. Here’s why:
You type rake my_task_that_doesnt_depend_on_the_rails_environment
Rails loads (10-20 seconds)
Only then does your superfast rake task run. Boring!
Looking for a solution I came across Xavier Shay’s attempt to deal...
1 tag
December 2011
1 post
Finally, a top technical dating tip: you’ve no idea how much more motivating it...
– Great post on finding tech co-founders by @andyy: http://www.kernelmag.com/scene/2011/12/desperately-seeking-sysadmins/
October 2011
1 post
Why Do Sandwiches Taste Better When Someone Else... →
When you make your own sandwich, you anticipate its taste as you’re working on it. And when you think of a particular food for a while, you become less hungry for it later. Researchers at Carnegie Mellon University, for example, found that imagining eating M&Ms makes you eat fewer of them. It’s a kind of specific satiation, just as most people find room for dessert when they...
May 2011
1 post
An awesome audio-visual feast. There are more at: http://www.quayola.com/index.php?/soundvisualisation/pta/
March 2011
1 post
Struggling to remember the order of the block arguments in Ruby’s...
– Me, in response to a question posed by @mathie: https://twitter.com/#!/philip_roberts/status/50880641654468608
February 2011
1 post
Reading Rails
I have been reading through the Rails source code today to spot bits of ruby/conventions/etc I haven’t seen before. Here are the ones I have got so far.
ActiveSupport adds Hash#symbolize_keys which returns a hash with the keys symbolized
If you are setting up constants in a class, it might be a good idea to freeze them so they don’t get changed later
ADAPTER_NAME =...
August 2010
1 post
3 tags
Upper Bounds
One of my favorite lecturers from university was Dr Iain Lindsay, who taught 4th year Digital System Design.
Judged against most of the other lecturers, who droned along to a set of dry powerpoint slides, his teaching style must have seemed “eccentric” to most of his students. Instead of a projector he scrawled across the blackboard, full academic gown flowing behind him. Where...
June 2010
2 posts
2 tags
Same-same, but different
Whenever I have a merge conflict after merging from a branch into another with git, I get confused which bits came from where:
In retrospect it’s actually pretty straightforward. HEAD always refers to your current branch in git, so from «« to ==== is what was in the branch you started in, and ==== to »» is what was in the branch you came from.
Easy. When you know...
2 tags
Sorry Sir, I need to see your Id.
I just bumped into the following little “bug” in my rails app. I was getting the id of a related object to use to fill a newly added column in a migration, and suddenly far too many of the objects were linked to id=4. (Take particular note of the final line).
So what’s going on? It turns out that as well as a database “id” (if the object is stored in the database),...
May 2010
2 posts
When you don’t create things, you become defined by your tastes rather than...
– _why
1 tag
Freaking Out is Not Constructive
A lot of Lib-Dem voters seem to be freaking out about the fact that Nick Clegg is in talks with the Conservatives. I am certainly no political analyst, but I think a lot of people could do with taking a step back and chilling-out a bit. Here are my thoughts
Like it or not the Conservatives received more votes, and more seats, than any other party in this election.
Nick Clegg and the rest going...
April 2010
1 post
2 tags
My Digital Britain Letter
As is currently in vogue, thanks to the astonishing lack of democracy around the Digital Economy Bill, I “penned” an email to the Rt. Hon. Alistair Darling MP.
Feel free to use all, parts, or none of it in your own letter if you haven’t already done so.
Dear Mr Darling,
It is rare that I take a considerable interest in politics. I spend my days working at a large local...
March 2010
4 posts
2 tags
Mass Media is Dead (to me)
It has been a long time since I’ve had a television. Apart from perhaps the odd occasion at other people’s houses, I haven’t really watched television since I lived at home 6 years ago.
Partly this is because a lot of my attention has been consumed by the internet, either bouncing from blog-post to blog-post on Hacker News, or building bits of the web for fun. The other reason...
1 tag
The difficulty of "why?"
This man takes metathought to a level I can only wish for.
3 tags
Biases, part 2
It’s always about money
As well as cognitive bias (see Biases, part 1), there is also plenty of physical bias in the world.
A simple example is a weighted coin. A regular coin has a 50% chance of coming up heads, and a 50% chance of coming up tails. However, by cleverly distributing a coins mass, it is possible to make a coin that has a bias towards either heads or tails. The brilliant...
1 tag
Biases, part 1
It’s all in the brain
The world is full of biases. Some of my favorites are cognitive, which frequently result in people (myself included) misinterpreting information, or making poor/wrong decisions, when they believe they are being rational and logical.
Being aware of these common biases is very useful, both for finding weakness in arguments you make, as well as in those of your...
February 2010
1 post
3 tags
Unspiration
When you are working through something difficult, it’s often useful to look for a source of inspiration. Something you would love to have created yourself, something to aspire to.
If you’re really struggling, inspiration can just be depressing. A sober reminder that maybe you will never be that good, the creeping doubt that maybe, you suck.
Well, if it’s a nasty piece of HTML...
January 2010
3 posts
2 tags
I think it’s a Ganglion Cyst.
– Anonymous GP Referring to the screw working it’s way out of my knee
2 tags
April 2009
3 posts
2 tags
Irrationality & Design
I am often derided for being too logical. Indeed, a recent personality test I took at work identified me as an INTP, the hallmark of which is apparently logic. On the other hand, the following personal anecdote would seem to be anything but logical:
The Flavia coffee machine at work takes a small packet and magically produces a much-needed, caffeine-laden cup of coffee. These sachets are held in...
2 tags
SiCamp Scotland '09 Idea
So Social Innovation Camp is coming to Scotland in June. If you haven’t heard of it, SiCamp is an intriguing concept, whereby people who have never met each other, come together over a weekend to develop a number of working webapps which address social needs (more).
After being introduced to the concept by SiCamper Katee Hui at a local web-dev meetup, I came up with the following idea...
Hello World!
Well Ewan McIntosh, I hope you are happy. This is at least the third blog (the other 2 I know of being Hilary’s & Roderick’s you have started after your recent berating of all the blog-less attendees of BarCamp Scotland 2009.
As well as being a response to Ewan’s bullying, this blog was started for two reasons:
A place to muse on my experiences in electronics, web development,...