## Running Multiple PHP Versions with Homebrew in OS X

Update: None of this will work now. Homebrew has changed all of the PHP formulas and removed a bunch of stuff. Assuming you have xcode and homebrew installed and running, follow these steps.

## Signing a Java Jar

Blogging this because it took far too long to figure out and because the documentation is spread across too many pages and isn't at all clear.

## Generate some signing keys.

keytool -genkeypair  -alias USERNAME  -validity 1000  -keystore FILENAME.keystore Answer some questions. The resulting FILENAME.keystore file must be kept private. This generates a key that's valid for at least 1000 days.

## Installing intl for PHP on OS X

Pecl will only try to install PHP extensions in /usr. But OS X's security model prevents that. This work-around works around the problem and installs extensions in different spot.

## UTF-8 Everywhere

Apache, PHP, and web browsers default to ISO-Latin-1 (aka latin1). MySQL defaults to latin1, with the latin1_swedish_ci collation.

## Run tests when they are saved

Python's watchdog module includes watchmedo, a command that watches files or directories. I like to use it to automatically run a test when the test is saved: [shell] $watchmedo shell-command \ --patterns="*.py" \ --recursive \ --command='echo "${watch_src_path}"; python "\${watch_src_path}"' \ tests/ [/shell]