Datamappify - A New Take on Decoupling Domain, Form and Persistence in Rails

This post is about the ruby library we are building - Datamappify, please go check it out. At Locomote we are building a relatively large web application using Rails. Before we began to lay the foundation, we knew very well that if we wanted the project to be maintainable we had to architect the system with extra care and attention. More specifically, we can’t rely on simply using ActiveRecord which combines behaviour and persistence as our domain models. We began our search for something that…

Would you be interested in reading such a book?

Apr 29, 2013|1 Min Read|Comments|

Would you be interested in reading such a book?

ActiveRecord and DB Migration Ate My Model Attributes!

Feb 27, 2013|2 Min Read|Comments|

Update: You might also want to check out reset_column_information. So a few days ago we started seeing the following errors on our Jenkins builds (swapped with fictional model and attribute names): attack_power is a new attribute we recently added to the Ironman ActiveRecord model. I was baffled, as the table column is clearly there but ActiveRecord couldn’t see it. This weird behaviour is confirmed by debugging the model: And by debugging the schema: So apparently somehow ActiveRecord ate our…

"Become A Better Developer You Can" - Video of My RubyConf China 2012 Talk

Dec 03, 2012|1 Min Read|Comments|

It was the first time I presented in front of 400+ people so I was really nervous - I blasted through the talk in under 30 minutes even though I was supposed to talk for 45 minutes, oh well. ;) Also, my slides are available too. P.S. If you’re located in China, you may view the talk at Railscasts China.

An Interview with Yukihiro "Matz" Matsumoto

Update: Please check out this new interview with Matz, done by Engineer Type. A week ago I went to Shanghai, China to attend and to give a talk at RubyConf China. The day before the conference’s first day a bunch of us were invited to a VIP dinner where we met with Matz and got to play with a device running MRuby. And I heard that earlier on that day Matz was ‘adopted’ by a book publisher to do an interview. I have found the interview (in Chinese), and found it to be really useful. So I…

"Become A Better Developer You Can" - Slides of My RubyConf China 2012 Talk

Nov 25, 2012|1 Min Read|Comments|

Contrary to what the title of the talk suggests, I am by no means a superstar developer myself. Though I would like to think that I am extremely passionate about what I do, therefore I love to share my thoughts and tips on web development and software engineering. Below is the version I used for my actual talk: Since I had been preparing for my talk for over a month, I’ve done many revisions to my slides. Here’s an uncut…

Photos from RubyConf China 2012

Nov 24, 2012|1 Min Read|Comments|

I had such a wonderful time at RubyConf China! So here are some photos from the conference. :) Gallery of photos of yours truly on stage: Gallery of photos I took mostly on the VIP dinner event the day before the conference:

SimpleCov: Test Coverage for Changed Files Only

Nov 13, 2012|1 Min Read|Comments|

The other day a colleague asked whether or not it’s possible to have SimpleCov return a group that only contains uncommitted changes. The answer is yes! After some digging around, we found the following way: Basically use git ls-files --exclude-standard --others for untracked files, git diff --name-only for unstaged files and git diff --name-only --cached for staged files.

Skinny Coffee Machine - A Simple State Machine with Observers

After a few nights of working on the 2.0 rewrite of jQuery Endless Scroll, I am now releasing one of the tools I built for the project: Skinny Coffee Machine. Skinny Coffee Machine is a simple JavaScript state machine written in CoffeeScript. It is fairly simple to use, with the flexibility of adding and removing observers for state transitions. Define State Machines Switch/Change States Observers Go check out the source code now! :)

Brewing Node.js on OS X without Xcode

If you are like me who has no need for a full Xcode installation just to get the command line tools, chances are you are using one of these: Apple’s Command Line Tools or the osx-gcc-installer. Recently Node.js has made some changes so that it no longer installs on OS X via homebrew if you don’t have Xcode installed. If you run brew install nodejs, you will get the following error: And if you run brew install -v nodejs, you will discover this line: The fix? It’s actually quite easy, simply do…