Archive for the 'Technology' Category

Recursive Object Traversal in Javascript (like PHP’s print_r…)

I’ve been banging my head against the wall for the past few weeks trying to debug Javascript issues in Internet Explorer. (I can hear you cringing already…) At least, with the advent of IE8, there is now an official script debugger included in the new Developer Tools. Unfortunately, it is severely lacking when compared to the [...]

Filed in Javascript, Technology No Responses yet

An Error Logging Decorator for the MySQLi Object (eMySQLi.php)

Okay, the first question I can hear people asking is:  Why? Why another database wrapper or Decorator object? Aren’t there enough of them out there already? Well, frankly, yes…  but I had a ton of this in my code and no easy pre-packaged solution I could find to resolve it:
$sql = ‘SELECT * FROM table’;
if ( [...]

Filed in PHP, Technology No Responses yet

Recursive Directories Into Multi-dimensional Array

I was messing around the other day with creating a multi-dimensional array of file names from recursively searching a given file system path. I tried the RecursiveDirectoryIterator and the RecursiveIteratorIterator from the SPL. While they are both very useful and fairly simple to implement, I needed to keep the multi-dimensional nature of the file system [...]

Filed in PHP, Technology 2 Comments so far

Change in CURLOPT_NOBODY option

Be careful when upgrading PHP, if you’re using cURL. Somewhere between PHP 5.2.6 and 5.2.9, the definition of the CURLOPT_NOBODY option was changed. After upgrading (under duress — but that’s a different story…), all my ecommerce scripts that handled posting customer data to our processing company were completely fuxored. My main ecommerce site was on [...]

Filed in PHP, Technology No Responses yet

Problems with vi, vim and the paste command

Have you ever tried to cut and paste text into vi or vim through a terminal, only to find the formatting completely screwed up? Yeah, me too…  I finally came across an answer to this pesky problem and it’s so simple, I’m surprised it wasn’t easier to find. The next time you want to paste [...]

Filed in Bash Scripting, Technology No Responses yet

Quick NIS passwd to LDAP script

I found this awk script while browsing around on the web. I was looking for a simple way to migrate an NIS+ passwd file to LDAP config and this is what I found. Unfortunately, when I went to cut and paste it into a script on my server, I realized it had a bunch of [...]

Filed in Bash Scripting, Technology One Response so far