Notes

JS Regex Unicode Categories

2010-02-20 16:54:40

For a project I needed to parse characters from specific Unicode categories. while http://www.regular-expressions.info/unicode.html this page suggests using the \p syntax for that, this is not supported by the Javascript Regular Expression E...


JS boolean arrays

2010-02-15 21:18:12

So Brian Leroux released his http://wtfjs.com/ WTFJS . An interesting collection of oddities concerning Javascript. Now it so happens to be I'm working on a similar project, going through the spec trying to find more of these oddities. ...


JS arguments to array

2010-02-14 10:48:42

Why do I keep forgetting this... :/ Convert the arguments object to a proper array. JS Array.prototype.slice.call(arguments); Hope it helps you... and hope I can remember this some day :p...


PHP dir cycle

2010-02-07 14:13:57

Cycle through a dir and get all the filenames... PHP $strDir = 'source'; // no trailing slash $hndlDir = opendir($strDir); while (($strFile = readdir($hndlDir)) !== false) { if ($strFile == '.' && $strFile == '..') { continue; ...


Forgetfull wording

2010-02-07 13:59:50

These are words I forget. I tend ti forget very specific words and it's quite annoying. This list will grow over time, but you can probably just ignore it :) Augment...


PHP Creating a Zip

2010-02-07 11:54:57

This is how you create and serve a new zip file dynamically in PHP... PHP $zipFileName = 'tmp.zip'; $fileToInclude = 'files/file.txt'; $textToInclude = 'hello world'; $objZip = new ZipArchive(); $objZip->open($zipFileName, ZIPAR...


PHP random string

2010-02-05 11:14:06

I needed to generate random usernames for creating random users and wanted to use a random string generator. There are quite some elaborate string generators out there, but I just wanted something simple. PHP doesn't provide this natively, for som...


Smarty date proxy

2010-01-29 17:20:18

Today I was building an RSS feed in Smarty. Pretty straightforward (really, why the hell would you need complex libraries for such a simple tasks??). Anyhow, the database is MySQL and as such, will return MySQL timestamps. RSS requires an rfc2822 tim...


Javascript IDE

2010-01-28 21:39:50

After 81 my rip on http://aptana.org Aptana yesterday, I figured it's only fair to try and sum up what kind of IDE would satisfy me. Right now I'm using a text editor with simple rules for parsing. It accepts curly br...


Aptana fail

2010-01-26 21:29:52

I heard a lot of buzz about http://aptana.org/ Aptana lately and just had to try it. So far I've not been able to find a good Javascript IDE but this sounded very promising. As the title suggests, it quite didn't come through for me. The ...