Nov 23
Get PHP working on Leopard (Mac OS X)
After I upgraded to Leopard from 10.4.x, my PHP processes stopped working. The new OS overwrote some configuration files. Check out this post on how to get things working again.
Nov 23
After I upgraded to Leopard from 10.4.x, my PHP processes stopped working. The new OS overwrote some configuration files. Check out this post on how to get things working again.
Jun 22
With dozens of “bundles” that allow for application-specific editing, the Mac text editor TextMate is a great tool for the researcher. I posted four screenshots below for Stata, LaTeX, Matlab and PHP. The most powerful is PHP as there is a default bundle that lets you run the script directly from the file. With a little work (install TeX on your Mac), you can easily compile and view your LaTeX files. The quick command(e.g. “begin + “tab”) make editing a breeze. What I like most is the syntax highlighting that it brings to editing .m and .do files. Moreover, you can create “projects” that let you easily handle multiple files.
Textmate with Stata
Textmate with LaTeX
Textmate with PHP
Textmate with Matlab
Jun 03
We want to subtract 6 months off of a set of dates. Let the date to be modified be defined in the variable $date. To get the timestamp of 6 months prior to this date we run
$unix_timestamp = strtotime("- 6 months", strtotime($date));
Then, to convert the date back into a human-readable format:
$new_date = date('y-m-d', $unix_timestamp);
and $new_date is ‘yyyy-mm-dd.’