Regexp Kung-fu

There are two answers guaranteed to show up on nearly every PHP question on Stack Overflow - use the mysqli/PDO extension instead of the deprecated mysql one (to avoid SQL injection), and that you can't parse HTML with regular expressions.

With that in mind, my favorite two answers:

  • [How PDO is still vulnerable to SQL injection attacks](http://stackoverflow.com/questions/134099/are-pdo-prepared-statements-sufficient-to-prevent-sql-injection/12202218#12202218) by Anthony Ferrara
  • [Parsing HTML with regular expressions](http://stackoverflow.com/questions/4231382/regular-expression-pattern-not-matching-anywhere-in-string/4234491#4234491) by Tom Christiansen

Github March Wrapup

I've posted a bunch of projects to Github in the last few months and haven't linked to them anywhere, so here's a quick roundup of recently notable projects:

  • [lib_timezones](https://github.com/iamcal/lib_timezones) - A PHP and JS library to handle user-specified timezones properly, with reasonable client-side auto detection.
  • [lib_classsify](https://github.com/iamcal/lib_classify) - A partial PHP port of Github's own [linguist](https://github.com/github/linguist) which can automatically detect the programming language, given a code fragment.
  • [js-emoji](https://github.com/iamcal/js-emoji) - A JavaScript library to allow display of Emoji in then browser for OSs without native support (anything that's not OSX 10.8 or iOS 6)
  • [lib_autolink](https://github.com/iamcal/lib_autolink) - My old PHP URL-detection and linking library, updated to handle multiple protocols.
  • [lib_solr_query](https://github.com/iamcal/lib_solr_query) - A PHP library to turn user-entered complex search queries into valid SOLR query syntax. Supports phrases, booleans, nesting, assertions and more.

SlowPal is one of that breed of product that does one thing well. It helps that PayPal's log are so infuriatingly slow to begin with.

Chrome continue to get better and better. Ilya Grigorik explains some of the optimizations going on under the hood in this chapter from an upcoming performance book. If you work on the web, it's a fascinating read.

Jason Evanish writes an excellent 25 things to know when moving to San Francisco. It's pretty much spot-on.

An interesting little piece on British environmentalist Mark Lynas, an early anti-GMO campaigner, who has come around after discovering science.

The Dutch

From the same guy who explained the difference between England, the United Kingdom and Britain, comes a video explaining the Netherlands. Or Holland, Or Whatever.

Buildy

Buildy seems like it might be fun, in a modern City Creator sort of way, but I haven't managed to create anything cool myself (here's my effort) and there's no good directory of player-created stuff. Have any of you been playing with it?

Appropriate Gifting

Just in case any of you were desperately trying to figure out a gift to buy me in the next two weeks or so, I wouldn't say no to this Gin Advent Calendar. In fact, I'd be pretty happy about it.

Lego Trees

Does anyone know anything more about the amazing Lego Christmas tree at the Trafford Centre in Manchester. I've only come across a single tweet, saying it was made of 350,000 bricks. Pretty impressive.

« Newer posts | Older posts »

About

This is the personal website of Cal Henderson, Slack co-founder & CTO.

I give occasional talks, write code and sometimes articles.

» About Cal

Archives

2026: Jan Feb Mar Apr May Jun Jul Aug Sep Oct
2025: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2024: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2023: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2022: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2021: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2020: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2019: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2018: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2017: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2016: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2015: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2014: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2013: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2012: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2011: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2010: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2009: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2008: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2007: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2006: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2005: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2004: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2003: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2002: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2001: Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec
2000: Jun Jul Aug Sep Oct Nov Dec

Recent Tags

ai aws books color covid emoji fonts games halflife hardware havana ibm japan lego maps math minecraft music php reading tube via-matts via-momorgan wiring

Popular Tags

apple awesome bacon code coding comics design flickr food games javascript lego maps movie music perl php programming software tech tv video visualization web