Skip to content

Category Archives: Software

Good looking codes?

I’m comparing some open source Javascript plugins. I won’t name names (unless I change my mind), because my point is not to bring public shame. I respect anyone who takes the time and effort to release an open source project.  
That said, I don’t think there is ever an excuse for releasing codes that been [...]

Setup PostgreSQL on Mac OS X

MySQL was feeling lonely, so I decided to install PostgreSQL as well:
sudo port install postgresql83 postgresql83-server
Now update your path by adding this line to your .profile:
export PATH=”/opt/local/lib/postgresql83/bin:$PATH”
# the exact order is up to you
I also recommend adding the architecture flag if you use an Intel-based Mac:
export ARCHFLAGS=”-arch i386″
# Don’t forget to restart your terminal or [...]

Understanding TextMate Paths

I recently installed Ruby 1.8.7 in /usr/local. I have Ruby 1.8.6 installed via MacPorts in /opt/local. I couldn’t understand why TextMate’s Ruby bundle was running Ruby 1.8.7 even though my bash .profile was setting PATH correctly; i.e. /opt/local/bin was before /usr/local/bin.
Several people in the #textmate IRC channel helped out, including Allan, the creator of TextMate, [...]

MethodTrails Demo at RailsConf

I just gave a quick talk about MethodTrails at RailsConf 2008.
MethodTrails visualizes the method call graph of Ruby source code. It generates a dot file that can be viewed with Graphviz. It requires Ruby 1.9, which gives you a great excuse to download the latest Ruby and see what it is all about. MethodTrails uses [...]

When Incremental Change Isn’t

At time marker 50:35 in his Git presentation to Google, Linus has a slide that says ”Performance is not secondary… it affects how you work .. and it affects quality.” At 54:50 Linus talks about “the kind of performance that actually changes how you work / it allows you to work in a completely different manner.”
These quotes are in [...]

Using Git for Backup

Sometime last week an idea popped in my head (most likely because I heard it mentioned sometime earlier) — why not use Git for backing up important server files (especially ones that live in /etc). I haven’t tried it out yet, but here are some interesting links that I plan on checking out soon:

A backup [...]

Improving attr_accessible

In my main project, I have sworn off the use of attr_accessible. It is not that I don’t believe in security. I do. The reason is simple: using attr_accessible makes it hard to use the block forms of new and create with any sort of confidence.
For example, if I use this in my Goal model:
attr_accessible [...]

Nginx Configuration

The Nginx wiki is helpful and well done. It is the definitive reference, unless you enjoy reading the C source code. Still, I wouldn’t mind finding some more content that explains Nginx. I’m the kind of person that looks for the why behind the how; it just makes me feel more comfortable when I understand [...]

Installing Oniguruma

Ruby 1.8.6 does not support look-behind using its default regular expression engine. To get this support, I needed the Oniguruma library and gem. Installation was a bit confusing on Mac OS X Leopard. These blog posts were helpful to get me started:

Juju explains how to build Ruby from source with Oniguruma patched in. I didn’t [...]

Thoughts on Delta Compression

Git can use delta compression to achieve substantial space savings.  As more data is added to a git project, relatively little additional space is needed.
I’ve been thinking through this and have the following observations:

The more different the additional data, the less effective delta compression will be, all other things equal.
It is pretty straightforward to realize [...]