Join Newsletter


Share with:

Recent Posts


I found that this was actually not a very good idea nor did it make my system faster. This will disable your computer's ability to use virtual memory. sudo launchctl unload -w /System/Library/LaunchDaemons/ To turn it back on sudo launchctl load -w /System/Library/LaunchDaemons/ However, note the command-line tool "purge"...

Read More

I got this error whenever I ran sudo apachectl restart starting after a recent upgrade to 10.6.5: /usr/sbin/apachectl: line 82: ulimit: open files: cannot modify limit: Invalid argument After this reading this post1, I changed /usr/sbin/apachectl line 64 from this: ULIMIT_MAX_FILES="ulimit -S -n `ulimit -H -n`" to this: ULIMIT_MAX_FILES="" References1....

Read More

In the "bugs that drive me crazy" category are two that I've recently discovered when I upgraded to the new iPhone 4. Both look like examples of programmers writing software from the comfort of their cushy high-speed internet connections and not testing in the real...

Read More

Here’s a common pattern and good rails thing to know about: read_attribute(:symbol)

Basically what it does is read the attribute from the object’s database field, even if you have over-ridden the name of that attribute with a virtual attribute of the same name.

When using Paperclip to save an attached image, how do I get & store the dimensions of the image? Best way is to create two fields to store the width & height and then just populate those fields when the image loads. (Other solutions, like reading it dynamically each, incur a lot of unnecessary disk activity.) Be sure to checkout some basic tutorials on Paperclip if you are unfamiliar with it generally. (see references below 1 2 3)

Step by step instructions.

1. create a new file at lib/paperclip_processors/thumbnail_with_dimensions.rb

2. Paste the contents of this gist into the newly created file:

OK, so I feel it is officially time to kill IE 6 and below. IE 6 has been the bane of web developers' existence for quite some time now. I say, just kill it. If your product manager whines and says "but we need to...

Read More