Leading Snowflakes by Oren Ellenbogen - A Pragmatic Book on Software Team Leadership I wish I Read Sooner

Two weeks ago as I was reading Software Lead Weekly which I had subscribed to for a while, I discovered its curator, Oren Ellenbogen's book - Leading Snowflakes.

It was a moment of discovery that lead to a stream of delightfulness.

It Started with a Long Day at Work…

After a long day at work, I was so beat I couldn’t even listen to audio books like I always do on my way to and from work. So I drove home that night in total silence. One thing that was on my mind at the time was - who should I reach out to for some advice and mentorship?

Read more ...

Photos from JSConf AU 2014

JSConf AU has been fun - great talks and great venue! It was also a wonderful opportunity for me to test out my new camera kit: SONY A7r + Sony Sonnar T* FE 35mm f/2.8 ZA + Voigtlander Color Skopar 20mm f/3.5 SL-II with Novoflex SONY E-Mount to Nikon adapter.

Here’s the kit (taken by Nikon D800 + Tamron SP 24-70mm F/2.8 Di VC USD):

Photos from JSConf AU 2014:

Read more ...

On Hiring: Trial Week - Yay or Nay?

Today a blog post titled “Trial Week: Our Hiring Secret" has made to the Hacker News homepage. I naively tweeted my dislike and now I feel obligated to share my thoughts in a more meaningful and constructive way.

First of all, congratulations to the Weebly team, as this trial week strategy is clearly working very well for them.

I, on the other hand, am against using a trial week for vetting candidates, and I am going to share my thoughts.

Let this serve as a reminder to the rest of us: every organisation and team is different, so think carefully before committing to a given strategy.

Read more ...

Protip: Unsync the “Index” Folder of Sublime Text 3 from Dropbox

If you’re like me who uses both Sublime Text 3 and Dropbox, chances are you have your Sublime Text 3 folder synced in Dropbox.

I use my laptop as my primary workstation so most of the time it’s docked and charged. Occasionally when I do use it on battery power however I notice the extremely poor battery life - typically only 2-3 hours.

Eventually I realised the power consumption was caused by Sublime Text 3 generating a temp file in its “Index” folder every second or so, and that triggers Dropbox to do the syncing - causing it to take 40-50% of CPU constantly.

So, here’s a simple fix. Click on the Dropbox icon, then click on the gear icon and select “Preferences…”, select the “Advanced” tab, and select “Change Settings…” for Selective Sync to bring up the column-based file dialog, now simply find and untick the “Index” folder and you’re all set. :)

Protip: Faster Ruby Tests with DatabaseCleaner and DatabaseRewinder

Please also see this blog post on tweaking your ruby GC settings.

I use and love DatabaseCleaner, although historically I had never paid too much attention on the performance of its varies cleaning strategies - I’d always used truncation.

We use Postgres, and after digging around and finding out the difference between DELETE and TRUNCATE, I ended up improving our test suite speed by about 30-40% simply by tweaking the cleaning strategies.

Read more ...

Protip: Ruby Devs, Please Tweak Your GC Settings for Tests!

It was made apparent to me that many ruby devs either aren’t aware or couldn’t be bothered to tweak their ruby garbage collector settings.

Well, if you are using MRI, please start tweaking your GC settings. Here’s what I use (on my 15” Macbook Pro Retina):

export RUBY_GC_MALLOC_LIMIT=90000000
export RUBY_FREE_MIN=200000

Not only can you tweak it for your local dev machine, you can also tweak Jenkins, Travis CI, Wercker and other CI solutions, making instant speed gain for your test suite!

Here’s what we get:

             Before   After
Local:       8m22s    5m52s
Travis CI:   10m10s   6m0s
Wercker:     8m45s    6m24s

YMMV depending on your system and available RAM.

Writing Sensible Tests for Happiness

Writing good, sensible tests is hard. As a Rubyist, I feel lucky to be part of a community that embraces tests. Though at the same time, I have come across too many projects that suffered from not having sensible tests.

What are Sensible Tests?

There often isn’t a silver bullet when it comes to software development. Technical stuff aside, many things contribute to the solution to a given problem - the team, the project and the business to name a few. This article does not attempt to present any insights into the best practices for testing, rather it collects a few tips I believe would benefit those who are yet comfortable with writing tests.

To me, sensible tests often have the following characteristics:

Read more ...

Gotchas in the Ruby Sequel Gem

I haven’t really used Sequel much therefore I am definitely a newbie. However, after days and nights of frustration, endless debugging and some search-fu during the development of Datamappify, I have finally arrived at the conclusion that Sequel is a capable library, as long as you are aware of the gotchas.

Gotcha 1: Always use “select”/”select_all”, or your data records will mysteriously have wrong IDs!

In ActiveRecord, joining an associated model couldn’t be simpler:

Post.joins(:author)

In Sequel, despite having a similar API for models to declare associations and their corresponding primary and foreign keys, you cannot do a join without specifying the keys:

Read more ...

The Future of Computing, The Future of Computer Programmers - An Interview with Yukihiro “Matz” Matsumoto

A while ago I translated an interview with Matz done by a Chinese book publisher. The interview and the translation were well received, so this time I am translating another interview with Matz, done by Ito, the editor-in-chief from Japanese website Engineer Type. Since I don’t read Japanese, the translation is based on Turing Book’s Chinese translation.

The Chinese translator has done a great job translating the interview, but there are still many words and sentences lack sufficient context and therefore are difficult to grasp. I have put in many hours translating the text as well as doing researches to ensure the final article is readable. I hope you will enjoy it! :)

Read more ...

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 help us decouple our application from the domain layer down to the form handling. We’ve found a couple of gems that are close to what we were after - Curator, Minimapper, Edr and later on Reform. They are all wonderful gems but unfortunately none of them has everything we need.

Here are the things we need:

Read more ...