"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: https://speakerdeck.com/fredwu/2012-become-a-better-developer-you-can 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…

Fix OpenSSL Error on Mountain Lion (and RVM)

Aug 06, 2012|1 Min Read|Comments|

Don’t you just hate it when you have a fresh intall of Mountain Lion, RVM and some rubies - then all of a sudden you hit this OpenSSL::SSL::SSLError error message: SSL _ connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed The fix is quite simple actually, all you need to do is to download a CA root certificate: And that’s it! Enjoy!

API Taster: Visually Test Rails Application API

Jul 02, 2012|1 Min Read|Comments|

Like a lot of places, at Locomote we are building a platform that is API-based. As much as I like having comprehensive test suites, I often feel the need to manually test API endpoints to see exactly what the responses are. Tools such as Postman solves part of the issue: they allow us to quickly test API endpoints without messing with cURL . But as a lazy developer, I want more. ;) I want something that: automatically generates API endpoints from Rails routes definition defines input params…

PHP Devs: Have You Started Playing with More Toys?

Jun 29, 2012|4 Min Read|Comments|

TL;DR - PHP is still a useful tool, but as a PHP developer, have you started playing with other useful tools? Here’s my story. Today Jeff Atwood’s new piece " The PHP Singularity " and Marco Arment’s " PHP Addiction " have started another round of heated discussion on PHP. As someone who started his career as a PHP developer, I feel like sharing my thoughts from a different perspective. I began my career as a freelancer - since JavaScript and PHP were the two programming languages I learnt at…

[Rails Tip] Render views outside of Controllers or Views

Jun 20, 2012|1 Min Read|Comments|

Ever wondered how you could utilise the render method outside the context of Rails controllers and views? If you wonder why anyone would do that. Well, imagine you are building an awesome form builder, you need to output and/or store rendered partials in the buffer. How do you do that? For example, what if you want to do this in your view? You could do something like this: The idea is to mixin the render method, but also ensuring the view buffer is correctly reset with flush_output_buffer…

Agile is not a Sham

Mar 28, 2012|2 Min Read|Comments|

This blog post titled " Agile is a Sham " offends me a little bit. The post screams hey, I am a cowboy programmer , and it almost implies that if you employ processes then you are stupid. In this day and age, I would have thought finding the right tool for the right job is common sense. Apparently not. Agile, among many other things, is not a silver bullet - it never was and it never will be. The key thing is to experiment and find what works for you, your team and your company . Most…