Blog

@fredwu 12 years ago | 1 min read | no 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: []
@fredwu 12 years ago | 1 min read | no 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: # in spec_helper.rb SimpleCov.start 'rails' do add_group 'Changed' do |source_file| `git ls-files --exclude-standard --others \ && git diff --name-only \ && git diff --name-only --cached`.split("\n").detect do |filename| source_file.filena...
@fredwu 12 years ago | 2 min read | no comments
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 @coffeeMachine.power = new SkinnyCoffeeMachine default: 'off' events: turnOn: off: 'on' ...
@fredwu 12 years ago | 1 min read | no comments
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: \> Error: Failed executing: make install (node.rb:28) And if you run brew install -v nodejs, you will discov...
@fredwu 12 years ago | 1 min read | no 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: curl http://curl.haxx.se/ca/cacert.pem -o ~/.rvm/usr/ssl/cert.pem And that’s it! Enjoy!
@fredwu 12 years ago | 1 min read | no 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 p...
@fredwu 12 years ago | 4 min read | no 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 scho...
@fredwu 12 years ago | 1 min read | no 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? <%=raw Awesome::FormBuilder.new(some_options).html %> You could do something like this: module Awesome class FormBuilder < AbstractController...
@fredwu 12 years ago | 2 min read | no 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 software proj...
@fredwu 12 years ago | 3 min read | no comments
Today an interesting blog post on Zend Framework has made to the Hacker News front page. I have to agree with the author - Zend Framework is an over-engineered piece of software. A few years ago I was working full time as a PHP developer. Naturally, I had experimented with lots of frameworks, including CakePHP, CodeIgniter, Kohana, Yii, Symfony and obviously, Zend Framework. Over the years, I had developed many projects primarily using CodeIgniter and later on, Kohana. There was one project tha...