Compiling wkhtmltopdf on Mac OS X 10.7 Lion

Posted by & filed under PHP, Techie.

Wkhtmltopdf is extremely cool. I’ve used qtwebkit for generating server-side page images before using python-webkit2png, and that’s fine (unlike using Firefox running in xvfb!), but I need to produce PDFs. So, I looked around and found several neat, simple PHP wrappers for calling wkhtmltopdf, and even a PHP extension. “Great”, I thought, “I’ll just install… Read more »

Domain name validation

Posted by & filed under PHP, Techie.

I was revisiting the validation of domain names and realised that most of the regexes posted around the web have faults. Many refer to Sean Inman’s 2006 post, which does a fair job but is prone to break as new TLDs are introduced. This answer on StackOverflow is about the best I’ve found so far:… Read more »

PHP Base-62 encoding

Posted by & filed under PHP, Techie.

There’s a really horrible bug (they won’t call it that, but I can’t think of any use case for the default broken behaviour!) in Apache’s mod_rewrite that means that urlencoded inputs in rewrites get unescaped in their transformation to output patterns. The underlying ‘bug’ remains unfixed even in 2.3, though a workaround in the form… Read more »

Google Charts API Simple and Extended Encoders in PHP

Posted by & filed under PHP, Techie.

Google’s charting API has been around for quite a while now, but I’ve only just needed to actually look at it. It became immediately obvious that I needed a PHP encoding function, so off to google I went. Though I found several implementations, they were all incomplete or deficient in one way or another (and… Read more »