Monthly Archive for May, 2009

Videobox & Mootools 1.2.x

I love MooTools. I’ve been using it before the 1.2 days; it has been great watching how much it has matured. One of the best things about MooTools is the amount of components that have been written for it: Videobox, SlimBox, and TextBoxList just to name a few. However, the switch from 1.1 to 1.2 broke alot of existing functionality and with that broke alot of the existing components.

Just the other day I found just the component I was looking for: Videobox. The examples on the site looked great, but it didn’t work with the newest version of MooTools. I spent some time converting the animation code over to the new 1.2 syntax and fixing some other random bugs, you can grab the fixed version here. I emailed the developer with the fixes, so hopefully he will post it on the project page soon.

Regex Revisited: Ack, SED, and TextMate

Grep has long been considered the de-facto regex command line tool for unix developers, but I’ve never really liked it. Grep has always seemed slow, buggy, and limited in its regex capabilities; I always resorted to using the built in regex functionality of TextMate or Python’s built in regex abilities.

As great as Python and TextMate are, they are not a clean solution to a simple problem and do not play nicely with shell scripting. Thankfully I’ve finally found a regex tool that fulfills my expectations: ack. There is an even a “Ack in Project” TextMate Plugin (so long Grep in Project) which works blazingly fast. Combine ack with the fixed and fully functional macports gsed (aka GNU sed) and I my command line text processing facilities are finally what they should be.

On a quick side note, I’ve come across another nice plugin for TextMate: ProjectPlus. ProjectPlus adds some nice UI as well as functional additions to the standard project drawer, it’ll help hold me over until TextMate 2.0 comes around.

Apple Mail: Mark as Replied

A while back I added a small file to the source section of this site, MarkAsReplied.applescript. Couple this small AppleScript with MailActOn and you have an easy way to change the replied status of messages. I have another post in which I posted a script to allow the marking of messages as unread. Although these are small little functionality additions to Apple Mail, they have helped keep my different mail accounts organized.

Best CSS Compression Around: CSS Optimizer 1.1

After almost four years I’ve released the next – and possibly the last for a very long while – version of CSS Optimizer. Aside from minor optimizations, I’ve fixed the last remaining parser bug having to do with “font: 62.5%/1.2em”. I haven’t yet updated the GUI application, but the command line application for linux and os x is updated. I’ve also fixed all issues with the online web css optimizer. Also a little while ago I added a css optimizer web service to allow easier integration to custom automation systems.

I’ve tested CSS Optimizer against some of the newer CSS optimizers such as YUI compressor as well as other online compressors and CSS Optimizer has always come out on top. I’m not one to claim having the “best of” something but I’ve tested many CSS files and CSS Optimizer has always created smaller files and is easy to integrate into any production script/automation system.

Interactive PHP Shell

PHP is an amazing language, I’ve appreciated it and its community more and more since I’ve been forced to mull through some ASP code. One thing it lacks in comparison to other languages such as BASH, Python, or Ruby is an interactive shell to test code in. A while back I found a nice little command line script that creates a quasi PHP shell. It isn’t perfect but it works pretty darn well for simple code testing and makes developing PHP scripts a bit easier. In addition to the command line shell a couple days ago a simple GUI PHP console, PHP console, was released. It seems to work fairly well, although I prefer the command line shell.

Installing Custom PHP5 In Leopard

Lots of improvements have been made in Leopard, but the built in installation of PHP still lacks some essential packages and extensions (PDO, GD, etc). You could download MAMP or Marc’s package but either of those isn’t exactly a drop in replacement for the built in PHP installation – I’d rather not have two separate PHP installations floating around on my computer.

Below is a script to compile PHP as a drop in replacement. I didn’t come up with this completely on my own, these two sources were a great help. You’ll need to make sure you have MacPorts installed in order for the installation of additional modules using the script below to work. Make sure that MacPorts is configured to install all files into the

/opt

directory on your hard drive. The only downside to not using Marc’s package or MAMP is every time there is a system upgrade you’ll have to rerun this script.

# you'll have to aquire a new URL here: http://us3.php.net/downloads.php when a new version of PHP comes out
wget http://www.php.net/get/php-5.2.6.tar.gz/from/us.php.net/mirror
open php-5.2.6.tar.gz
cd php-5.2.6

# strip the 64 bit version of apache in order to eliminate compatibility issues with 32 bit PHP
sudo lipo /usr/sbin/httpd -thin i386 -output /usr/sbin/httpd

# install some modules
sudo port install libpng && sudo port install jpeg && sudo port install freetype && sudo port install gd2

# compile and install PHP
./configure --prefix=/usr --sysconfdir=/private/etc --with-config-file-path=/etc --mandir=/usr/share/man --infodir=/usr/share/info --with-apxs2=/usr/sbin/apxs --with-zlib-dir=/usr --with-mysql-sock=/var/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-pdo-dblib=/opt/local --with-mysql=/usr/local/mysql --with-pear --with-pdo-mysql=/usr/local/mysql/bin/mysql_config --enable-sockets --enable-dbx --enable-dbase --enable-trans-sid --enable-exif --enable-wddx --enable-ftp --enable-mbstring --enable-cli --enable-mbstring --enable-mbregex --enable-sockets --without-iconv --without-openssl --with-gd --with-curl --with-sqlite --with-jpeg-dir=/opt/local --with-gd=/opt/local --with-png-dir=/opt/local --with-freetype-dir=/opt/local && make && sudo make install

You will have to restart apache by toggling the “Web Sharing” checkbox off and on in the Sharing preferences. Hopefully this saves someone the headache it caused me :)

Quick side note. I’ve been looking for a good replacement for the clipboard history component of Quicksilver for awhile now and recently found Clyppan. I love it so far!