May 10th, 2008 |
Published in
Howto, Mac, PHP, Programming, Software
The JavaScript Tools bundle for TextMate automatically runs JavaScript Lint on your files when saving and shows a little tooltip if there are any errors (like the missing semicolon below).

It’s very easy to enable similar functionality for PHP files. The default TextMate PHP bundle already comes with a ‘Validate Syntax’ command but it’s bound to Ctrl+Shift+V. Here’s what you need to change:
- Open up the Bundle Editor by hitting Ctrl+Option+Apple+B or opening the Bundles menu and selecting Bundle Editor > Show Bundle Editor.
- Find the PHP bundle in the list on the left and open it up.
- Select the ‘Validate Syntax’ command and then change it’s ‘Save’ option to ‘Current File’ in the dropdown on the right.
- Change the keyboard shortcut to Apple+S (or whatever you use to save) in the lower right. Your settings should now look like this.
- Close the Bundle Editor (it saves your changes automatically).
Below is an example of what you’ll see when saving. It will even move your cursor to the line with the error!

Update (2008-5-23): You can prevent the tooltip from displaying when there are no syntax errors by changing the command to:
#!/usr/bin/env ruby
require ENV['TM_SUPPORT_PATH'] + ‘/lib/textmate’
version = %x{#{ENV['TM_PHP'] || ‘php’} -v}.split[0..2].join(’ ‘)
#puts “Running syntax check with ” + version + “…”
result = `#{ENV['TM_PHP'] || ‘php’} -d display_errors=on -l`
puts result.gsub(’in -’, ”) unless result =~ /No syntax errors/
TextMate.go_to :line => $1 if result =~ /line (\d+)/
July 22nd, 2007 |
Published in
PHP, Webdev
In order to learn a bit more about screen scraping with cURL, I coded up a script to generate an RSS feed of Safeway’s weekly specials. The number of frames and strange redirects on Safeway.com shows that they probably paid some lifeless company a ton of money to develop it for them (Vertis, in this case). I can only imagine the frustration their engineers must have while trying to debug this stuff.
Try it out, and let me know if it works for you! Safeway Weekly Specials RSS
July 15th, 2007 |
Published in
PHP
Glad to see that there’s an end in sight for PHP 4. From the php.net news:
Today it is exactly three years ago since PHP 5 has been released. In those three years it has seen many improvements over PHP 4. PHP 5 is fast, stable & production-ready and as PHP 6 is on the way, PHP 4 will be discontinued.The PHP development team hereby announces that support for PHP 4 will continue until the end of this year only. After 2007-12-31 there will be no more releases of PHP 4.4. We will continue to make critical security fixes available on a case-by-case basis until 2008-08-08. Please use the rest of this year to make your application suitable to run on PHP 5.For documentation on migration for PHP 4 to PHP 5, we would like to point you to our migration guide. There is additional information available in the PHP 5.0 to PHP 5.1 and PHP 5.1 to PHP 5.2 migration guides as well.
Hopefully this forces some people to upgrade their apps and allow the devs to focus on PHP5 more. Aside from the better OOP in PHP5 which I find to improve my development a lot, I have to agree with Matt in that we should all be spending our time on “design, copywriting, information, performance — the things that truly matter.” Does that make me a hypocrite for posting this?
June 25th, 2007 |
Published in
JavaScript, PHP, Plaxo, Webdev
Last night we released Plaxo 3.0, the product us HipCal guys have been working on at Plaxo for the past year. It feels great to have finally shipped a product and is nice to see all the positive press coverage. There’s nothing more motivating than positive feedback!
Plaxo 3.0’s front end is written primarily in JavaScript, a technology which very few others are using to create applications of this size. All of us have learned more than we ever thought we’d know about this little scripting language! Although JavaScript is fun to use, I’m really enjoying the switch back to PHP which we’re using for some of our future products.
My main contributions to Plaxo 3.0 were the calendar views, new WAP, and Pulse. Features like countdowns and a more interactive upcoming view were ideas we had for HipCal, and it’s great to see them make an appearance in 3.0. It’s also nice to see the new WAP, which I originally started as a small side project, make it to a shippable state within a few weeks, bringing us all one step closer to the “poor man PDA” (now we just need SMS alerts!). Pulse is just plain cool, and I’m very excited to watch it grow over the next few months.
Anyway, back to work!