Recent Articles

Link: Deleting object properties in Javascript

Jul 22, 2011   #php  #javascript 
I was looking for the proper way to delete an object property in Javascript and came upon this nice example. I figured it was worth sharing. I’ve also included a similar way of handling it in PHP. var obj = {asdf:''foo'',bar:''baz''}; obj.asdf = undefined; for ( var i in obj ) { console.log(i,obj[i]); } // outputs: // asdf undefined // bar baz var obj = {asdf:''foo'',bar:''baz''}; delete obj.asdf; for ( var i in obj ) { console. [Read more]

Link: Fix for IE using AJAX progress monitor

You think you’re going well with your web development until you go and try your site out on Internet Explorer, then you discover just how much work you have still to do. » After spending the last several months working mostly on backend code (MySQL, PHP, etc), I’ve started doing more JS work, mostly cross-domain XHR. I found this quote in my research and it has never been more apt. [Read more]

Nginx redirect to

Jun 29, 2011   #nginx  #redirect 
Just switched to using Nginx instead of Apache for my personal hosting. I’m surprised by how much quicker it responds and how much nicer the syntax is. I’ll probably log a few more of these nuggets for future reference. server { server_name; rewrite ^(.*)$1 permanent; } server { server_name; #Put here your domain hosting configuration. }

Link: Capifony: Deploy Your Symfony Application Painlessly

Jun 22, 2011   #deployment 
I’m currently using Symfony2 for a side project and was thinking about using Phing for deployment… However, now I’m considering Capifony. I’m surprised by the quality of support software available for Symfony. It may become my go to PHP framework in the future…

Link: symfony2 Blog Application Tutorial

Jun 22, 2011   #symfony2 
There needs to to be more tutorials on symfony2. From what I’ve played with so far, I’m loving it. The only problem is the lack of documentation and tutorials beyond basic, cookie-cutter functionality. In fact, I found this blog trying to figure out how to get my security-model tied to a doctrine2 entity. 

Link: Use Phing to update your SVN-version-controlled website automatically

Jun 20, 2011  
If you’re working on a PHP project, like with any other project, probably comes a time when you need to “build a new release,” e.g. update the production web site with the latest version of the code. And doing the whole thing manually isn’t the most efficient way to get things done, especially if you’re lazy, or have to do that every once in a while, over a long period of time. [Read more]

Converting PHP Date string to UTC

Oct 19, 2010   #datetime  #php  #utc 
We store all of our dates in the database in UTC. This makes it easy for us to pass dates around to our various applications (web, iPhone, iPad) and all pieces know how to convert to their respective local time. I came across an issue this afternoon that I had not encountered previously, since most of the dates that we store are generated on the server side either using gmdate() in PHP or UTC_TIMESTAMP() in MySQL. [Read more]

Overloading arrays in PHP 5.3

Sep 18, 2010   #php 
I recently built a simple PHP 5.3 framework to use on a new project. I know, I know, I built a framework again, even though I wrote off building frameworks earlier this year. Well, now that I am able to solely focus my efforts on PHP 5.3 development (all environments at my new job are in PHP 5.3), I decided that it would be fun to build a simple MVC framework using namespaces. [Read more]

Using the v.3 API with Zend Framework

Aug 3, 2010   #bitly  #php  #zend framework 
I recently looked at providing a URL-shortening service for our new sharing module. Right now, my needs are very minimal, so I decided to write a class (currently using static methods) that utilizes Zend_Http_Client to communicate with API service. Here’s my code: <?php class My_UrlShorten { const bitlyLogin = ''LOGIN''; //Your login here const bitlyApiKey = ''API_KEY''; //Your api key here /** * Returns a URL shortened using the Bit. [Read more]

Objective-C for PHP developers: Checking for a method

Jun 22, 2010   #cocoa touch  #objective-c  #php 
I created a REST-based service the other day that uses method_exists to verify that the requested action exists in the processing class. This allows my service bootstrap to be more dynamic, as I can load various classes (for example, an image processing class) and verify that the action is valid. If not, I can pass an appropriate error back to the client. Here’s a snippet of the code that I use: [Read more]