simple string interpolation in javascript

11 March 2008 // javascript. stuff.

two-liner that adds perl/php style string interpolation to javascript

more...

cut-and-paste technique for complex regexps

07 March 2008 // php. stuff.

It's often desired to transform some text ignoring specific parts of it. The "classical" example is to replace something in html, not touching the tags.

more...

generating combinations in php

10 September 2007 // php. stuff.

This is just a follow-up to the previous post, describes how to enumerate combinations using php iterators.

more...

generating permutations in php

16 August 2007 // php. stuff.

Generating permutations (all possible combinations) of characters or array elements is asked often in php groups. Although simple, the answer is relatively verbose, so I thought I post it here for later reference.

more...

printing a plain-text table

16 January 2007 // php. stuff.

php function that creates a plain text table from array of arrays

more...

closures in php

18 December 2006 // php. stuff.

Php is definitely not a suitable language for functional programming. Php functions live in a parallel reality - when your program starts, the construction of functions is complete, nothing can be changed anymore. However, Php is an open language (as it has eval ), so it should be possible to do some experiments.

more...

quasi blocchi in php

08 December 2006 // php. stuff.

Every programmer knows that iterators are generally better than loops. Although php has a variety of iterator functions, their use is seriously limited, because there is no way to pass user code to the iterator.

more...

php serialize trickery

30 November 2006 // php. stuff.

A couple of code snippets that show how to do some intriguing stuff in oop php using serialization

more...

zend opcode dumper

24 November 2006 // c. stuff.

This windows program I wrote recently prints Zend engine "assembler" generated from php code. Quite useful for understanding on what's going on there... and sometimes quite funny.

download

there are %d monkeys in the tree

29 October 2006 // php. stuff.

Simple functions to create php tree structures (nested arrays) from "flat" storage formats.

more...