Samuel Wong

Ramblings of a rocket scientist turned web developer

Simplicity

In my undergraduate engineering design course, we were taught to “KISS and MISS”, which stands for “Keep It Super Simple” and “Make It Super Simple”. (Or if you prefer, “Keep It Simple, Stupid”) I find this to be true in my work. Too often, I get sucked into building complex, flashy code at the expense of achieving the basics within a smaller timeframe. I think to myself: “wouldn’t it be nice to have an AJAX popup and a yellow-fade technique right there when the user clicks the button?” And I get excited about using my newly-learned Backbone.js knowledge… Oh, it goes on from there!

Two weeks later, I still haven’t pushed out that “easy” feature I promised I’d get done “in a few days.”

So I’m learning, again, how to keep things simple. It helps to know that software is always evolving and there are many opportunities to go back and refine code. Software development is a process and you gotta grow hair before thinking about your hair-dos. It also helps to know that humans are amazingly versatile and capable of tolerating inconveniences (even solving them in creative ways). There’s less pressure to deliver “perfect” software because crashes are “okay.”

It’s all part and parcel of this journey called development.

Thoughts on SOPA

There have been a huge uproar over SOPA lately. I thought I would weigh in on it because the Internet is so integral to my life and livelihood.

I am against SOPA because it breaks a foundational aspect of the Internet – reliability and security. In geekspeak, SOPA breaks the domain name system (DNS).

Amusement of the Day

I was playing around with Gollum and when I booted it up, I was greeted with a great log message:

== Sinatra/1.2.6 has taken the stage on 4567 for development with backup from Thin
>> Thin web server (v1.3.1 codename Triple Espresso)
>> Maximum connections set to 1024
>> Listening on 0.0.0.0:4567, CTRL+C to stop
^C>> Stopping ...

== Sinatra has ended his set (crowd applauds)

Wait! That’s Triple Espresso! I better update my Thin – it’s still on v.1.2.11 codename Bat-Shit Crazy.

Compiling the Bootstrap Framework

I recently migrated unstash to the next version of Bootstrap, v.2. Version 2 hasn’t been released yet, which means the CSS file isn’t available - I had to compile it myself. To do this, I had to install a bunch of software packages. Here’s how I did it.

Freelancer’s Guide to Productivity Tools

If you are a freelancer or entrepreneur, you’re a creator and you’re joining the ranks of Leonardo da Vinci, Michelangelo, and Vitruvius. (Don’t know Mr. da Vinci? Go to the science center, dude.) Okay, maybe you’re not that good and no one is commissioning you to paint the Sistine Chapel. But you and ‘Mike’ are cut from the same cloth – you’re both making something beautiful from nothing at all.

To do this hard work, it’s advisable to get the right tools. Sure, you can survive without them. In fact, it’s not the camera that takes good photos, it’s the person behind the camera. But once you get going and know the field better, having good tools will make life easier and allow you to concentrate on the real work of imagining and problem-solving.

Yes, this week’s episode on freelancing is about productivity tools.

How to Test ActiveModel Callbacks With RSpec

In unstash, every time a person (say, the owner of the item) makes a change to a loan request (i.e. he approves it), the other person involved in the loan (in this case, the borrower) is notified.

This is easy in Rails. In my Loans model, I have an after_save callback that runs LoanNotification.create_from_loan(self). I’ve purposely delegated the task of creating the actual notification and determining the recipient away from Loan. This is because Loans shouldn’t be responsible for how LoanNotifications are created (SRP).

Here’s how I implemented this in RSpec.

Octopress Is Way Sexy

Wordpress is the undisputed king of the blog engines, but he’s getting fat and bloated, sitting on that throne of his. I recently created an e-commerce website out of a Wordpress installation – honestly, is there anything Wordpress can’t do with the right plugin?

But let’s face it: using Wordpress is hard work.

Freelancer’s Guide to Workspaces in Suburban Toronto/GTA

So you’re a freelancer, entrepreneur, or part of a team at a startup company – congrats for taking the plunge. You’re joining thousands of like-minded, driven individuals who have decided to make their dreams a reality instead of just thinking about it. The perks are great: you work on what you like, how you like, when you like, and the commute time is the 5 seconds it takes to walk from your bed to the desk. Life is rosy!

But you’ll quickly realize there are some hidden battles to fight, and the most challenging ones are those that come from within. Over the next few weeks, I hope to write about some of these battles and how I’ve fared against them. This is mostly for my own benefit as I reflect on a year of doing full-time startup work. This week is about the workspace battle.

Notes on AndroidTO Conference

Just some of my personal notes from the AndroidTO conference in Toronto. Not all the slides/code from the speakers have been posted to the androidto.com site… boo-urns!

What’s covered:

  • Just Because It’s Mobile Doesn’t Mean It has to be Native
  • Android tips and tricks
  • Near Field Communication (NFC)
  • Rogers Catalyst
  • Kernels 101
  • Custom Views
  • Google AppInventor

FUSE for OS X and MacFusion

My new Mac Mini doesn’t have an optical drive. It’s a bit of a pain, but I definitely think it is the way forward. Soon, everything will be cloud-based and accessible over the Internet. But I still have old DVDs. What to do? Apple has something called Remote Disc. It allows other computers to share their optical drive over the network. I’ve tried it and works painlessly. Unfortunately, Remote Disc does not support Linux. What’s a Ubuntu lover to do? Go hacking with sshfs, of course.