Quick, but not dirty, PHP

Though I’m doing more and more work in Python, I still write a lot of PHP code, especially for quick one-off web automation tasks.

There is plenty of activity on the other end of the scale in the PHP world now: frameworks like Cake, WASP, Solar, TaniPHP, the forthcoming Zend Framework. All this action is very cool, but doesn’t address the one-page script – and the one-page script is still worth doing right.

Many people come into PHP helter-skelter, not realizing that “Wow, it works!” is not the highest level of achievement possible. I don’t offer myself as a PHP guru, but below are some of the conventions (I dare not call them “patterns”) I use that I think are worth passing along.

Tantek on CSS hacks

You can’t possibly consider yourself an expert wielder of HTML and CSS unless you’ve read this excellent history, explication, and analysis of CSS hacks. Even master practitioners of Wilbur need to read it. Especially master practitioners of Wilbur.

I was intrigued by the suggestion that hacks are supposed to look ugly to discourage you from using them. Bit of an ex post facto rationalization, I think!


Paul commented on Tue Sep 26 09:21:46 2006:

Django template bundle for TextMate

I added Wilson Miner’s TextMate bundle for Django templates to the TextMate bundle repository today. Thanks, Wilson!


comments commented on Sun Jan 15 11:46:27 2006:

the ‘scope’ selectors need to be changed. As is the scope text.html.django doesn’t work. text.html works fine.


Paul commented on Sun Jan 15 13:44:40 2006:

But then you get Django-style coloring in all your HTML files. It works as-is. You do have to specifically select the “language” from the language selector at the bottom of the window.

Brainbenched

Brainbenched

When I left you I was the learner. Now, I am the master.  – Lord Vader Once or twice a year I get an e-mail from Brainbench urging me to come take some free certification tests. Unfortunately, a lot of the tests are really out of date. I am currently Brainbench-certified in Apache 1.3.12 and Python 1.5 – both of which were already 4+ years out of date when I took the tests last year. I think I’m proudest of my 99th-percentile “HTML 3.2 MASTER” certification. It’s very Web 1.0!

BASIC Computer Games

BASIC Computer Games

In 1981, I was 13 years old and teaching myself BASIC on my TRS-80 Model III from official Radio Shack manuals – accurate, comprehensive, and terminally bland.

Into that gray scene came the book Basic Computer Games: Microcomputer Edition (edited by David Ahl of Creative Computing magazine). It changed my life.

I can’t remember now where it came from. Neither my parents, nor my friends, nor my teachers knew much about the home computer scene. It’s possible that I found out about it in Creative Computing magazine and ordered it by mail, or “borrowed” it from somewhere and forgot to return it. The book, subtitled “101 great games to play on your home computer,” was 8-bit-nerd heaven. Pages and pages of program listings in tiny, all-caps, dot matrix type, with brief introductory paragraphs. Plus, funny illustrations of strangely plausible robots. Don’t underestimate the appeal of the robots.

RSS tweaks

Just made some minor improvements to the RSS infrastructure here on the site:

  1. There are now feeds that allow you to follow comments on an individual post (look for the “comment feed” button).

  2. I created a minimal stylesheet so that feed-reader-less users will see something a little prettier and more informative in their browser if they attempt to view a feed directly. There’s much more I could do here (with XSL for instance), but it’s a start. This actually was the first time I’d ever written a stylesheet for XML content.

Holy hot-headed hippies, Batman

There’s a blowup in progress in the Internet Archive forums over the removal of Grateful Dead concert recordings. The official announcement at the top of the thread reads, in part:

Based on discussions with many involved, the Internet Archive has been asked to change how the Grateful Dead concert recordings are being distributed on the Archive site for the time being… Audience recordings are available in streaming format (m3u). Soundboard recordings are not available.