Monthly Archives: August 2008

use Quick Look as a Firefox application handler

I really dislike getting screen-shots in the format of power-point files. Thankfully, 10.5’s Quick Look can help me preview power-point files. What I needed was a way to have Firefox automatically Quick Look all power-point files that I downloaded. Here’s how to do it: Open up Script Editor and paste this: on open filelist repeat with i in [...]
Posted in shell, sysadmin, tips | Leave a comment

lftp has an option mirror:order

We’ve been using lftp for years here. It’s stable and has a volume of options. I just found out today that lftp has an option to set the order in which files are uploaded if you are using the mirror command. You can set it like so: set mirror:order '*.jpg *.gif *.png *.js *.css * */' This [...]
Posted in deployment, programming, sysadmin, tips | Leave a comment

String interpolation is faster than printf in Ruby

Just wanted to make a note, string interpolation is faster than printf in Ruby. Example: $ irb >> require 'benchmark' => true >> Benchmark.measure { 100000.times { "%s" % ["hello world"] } }.total => 0.21 >> Benchmark.measure { 100000.times { "#{'hello world'}"} }.total => 0.04
Posted in ruby | 1 Comment