It’s Year 2011, Why Aren’t People More Open-minded?

On a cold windy day, we are comfortably sitting in our chairs beside the fireplace, holding a mug full of hot tasty latte. We are slowly and calmly sipping on our coffee, imagining that things could be far worse outside of our safe and warm house.

Exactly how do we know that things could be far worse? We don’t, because we are too comfortable and too familiar with what we currently have.

Being happy with where you are is one thing, being ignorant is another.

Inventions and innovations aren’t born out of happiness, they are born out of frustration, anger and sometimes, curiosity.

Being open-minded about how things work, in my opinion is one of the key attributes an entrepreneur should have.

Read more ...

Comic: Because ActiveRecord is Slow!

Comic: Because ActiveRecord is Slow!

Moving On From Envato, What’s Next?

Today is my last day at Envato. I have been working here for a year and half and it has been, without a doubt the most fulfilling experience I have ever had in my professional career.

I was hired as a PHP developer initially. Who knew, several months into the job I was ‘converted’ voluntarily to a full time Ruby developer - and it has been the highlight of my career progression. It is hard to imagine what I would have become if it wasn’t for Envato’s support behind my conversion.

During my time at Envato, I had the opportunity to work with some of the most talented people in the web industry, from both inside Envato and externally. I am extremely grateful for the experience and I hope to work with them again in the future.

The decision of moving on from Envato was not made easily. As a matter of fact, I have always been passionate about online education (e.g. the Tuts+ network) and I sincerely hope the project will be taken to the next level.

Read more ...

Sneak peak of the redesign of slim-lang.com. :)

Sneak peak of the redesign of slim-lang.com. :)

[Ruby] Releasing Ssync - An Optimised S3 Sync Tool Using the Power of Unix!

At Envato we have a few dozen sites residing on multiple servers. The data on a portion of the servers need to be regularly backed up to Amazon S3.

The Envato Mad Scientist Ryan Allen has worked on a script called Sir Sync-A-Lot which syncs the data to S3. This was done after evaluating a bunch of scripts including s3sync.

Today I turned Ryan’s original script into a little Rubygem and added a bit more features.

Go check out the source code!

A Speedier Rails App using Rails 3.1 + Arel 2.0

Before (Rails 3.0.1pre stable branch + Arel 1.0.1):

After (Rails 3.1.0 master branch + Arel 2.0.0dev master branch:

Thanks to the awesome work done by Aaron Patterson (@tenderlove) and others. :-)

UPDATE:

After Aaron Patteron’s tweet, I ran the tests again on Rails 3.0.1pre stable branch + Arel 2.0.0dev master branch, and the result blew my mind:

`bundle: command not found` or `Could not find RubyGem bundler (>= 0)` During Capistrano Deployment? No Problems!

Don’t you just hate it when you get the following errors during a Capistrano deployment?

bundle: command not found
Could not find RubyGem bundler (>= 0) (Gem::LoadError)

In fact, even if you don’t use bundler, you might still get errors like this:

rake: command not found
Could not find RubyGem rake (>= 0) (Gem::LoadError)

It turns out this has something to do with the $PATH and $GEM_HOME variables.

So here’s the quick fix.

Log in to your deployment server, as a root user, add the following line to /etc/ssh/sshd_config:

PermitUserEnvironment yes

Don’t forget to restart ssh:

/etc/init.d/ssh restart

Now, log in as the deployment user, and create ‘~/.ssh/environment’ with the following content:

PATH=/usr/local/rvm/gems/ruby-1.9.2-p0/bin:/bin:/usr/local/rvm/rubies/ruby-1.9.2-p0/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
GEM_HOME=/usr/local/rvm/gems/ruby-1.9.2-p0

* The above paths are for your reference only, obviously you need to work them out for your server environment. The only thing you need to make sure is that the GEM_HOME’s path matches one from the PATH.

Now, to verify this all work, you may use cap shell to start a new shell session and try out your commands.