Programming
7 05 2013
PHP errors can be a obnoxious when you’re developing an XHR heavy application with lots of JSON responses. The errors just aren’t very readable. So today I finally decided to implement ChromeLogger in our application here at work. This is one thing I’ve always missed since moving away from FireFox and its excellent plugin FirePHP.
31 01 2013
Just a quick note. I released a new component for CakePHP that provides server-side interoperability between CakePHP 2.x and jQuery DataTables plugin. Features Takes paginated data and converts into json response compatible with datatables Accepts dataTables ORDER BY requests Accepts dataTables WHERE conditions Accepts dataTables pagination Works LinkableBehavior and to a lesser extent Containable Dependancies [...]
28 12 2012
I had a domain that generates me about a grand each month get spanked badly by Google due to the work of an outsourced SEO. Luckily Google released a tool to disavow bad links. I suggest reading Googles blog post on the matter at http://googlewebmastercentral.blogspot.com/2012/10/a-new-tool-to-disavow-links.html to ensure you are using the tool properly and know when to [...]
12 10 2012
I recently was tasked with a rather complex project involving scraping hundreds of thousands HTML documents. Normally scraping is quite easy. I have a lot of experience with it and just use the wonderful Simple HTML DOM library . Simple HTML DOM has some issues though. It chokes on large HTML documents. And when running [...]
27 06 2012
If you don’t have a debugger setup or would rather just see this sort of information in a log format use this snippet to find where a method is being called from. Note, if you have NetBeans configured with XDebug you can add a break point and watch the callstack for this sort of information. [...]
5 05 2012
XHProf is a function-level hierarchical profiler for PHP and has a simple HTML based navigational interface. The raw data collection component is implemented in C (as a PHP extension). The reporting/UI layer is all in PHP. It is capable of reporting function-level inclusive and exclusive wall times, memory usage, CPU times and number of calls [...]
15 02 2012
It’s been a while since I last posted on here so I thought I’d get something up here before my next big blog post. Since starting a new job back in September I’ve been working in CakePHP 1.3 (soon to be 2.0). The other day I had the opportunity to explore optimizing CakePHP. My employers [...]
28 10 2011
I recently blogged on Reducing Code using CodeIgniters Active Record Class. In this blog I focus on easily collecting data from your object members using get_object_vars(). After using this for a while I found that unsetting certain members prior to an insert/update became rather annoying. I’ve been knee deep in Code Igniter for the past [...]
5 10 2011
I performed some unscientific PHP benchmarks today pitting casting to an integer against is_numeric against preg_replace. The point was to see which is the fastest way of quickly cleaning user input before passing to a SQL query to prevent against SQL injection. Obviously this would only work on database fields that are integers. To be [...]