Web Developer
Code Igniter
Cropping images with CodeIgniter and jQuery
Aug 27th
The art to having a website with decent imagery is to allow the user/administrator to crop the images. Despite advancing web technologies, I still cannot trust a computer to scale, resize or crop an image without the resulting image being of someones foot.
There are certain ‘off-the-shelf’ products, mainly for ASP.net, with very little introduced into PHP, so I had to build my own using helpful libraries and plugins.
The Cropping
Writing a JavaScript cropping tool from scratch is no small challenge, getting a bug-free environment where all of the calculations are perfect can take weeks of hairless programming sessions and various mental breakdowns! And with my hair still in tact and mental capacity intact I implemented jCrop (I let someone else do the hard work). I am continuously reminding people that reinventing the wheel is both a waste of time, energy and sanity but the odds are against you. If a plugin is popular then the chances are that their solution will be 10 times better than yours as theirs have probably evolved over several months if not years!
Implementing oAuth Twitter with Code Igniter
Aug 25th
On August 31st Twitter will be axing basic auth GET requests, which is being overtaken by the more secure oAuth, there are a few tutorials out there on how to use oAuth and how to get started creating an app with CodeIgniter, but not many with actually helpful advice so here is my 2 penneth.
How to get started with oAuth
Codeigniter Database session fix
Aug 23rd
For weeks I tolerated the annoyance of CodeIgniter’s Session library logging my out continuously, saying to myself “I works…kind of… ill fix it later”. Eventually the problem started affecting AJAX method calls, large file uploads and simple CRUD operation forms so I began trawling the internet for a fix.
After hours and hours, I found that there was no _reliable_ fix to the database sessions library and that the answer was, DON’T USE DATABASES.
I found this extremely helpful library fix: CI_Native_Session.
Extending CodeIgniter’s validation routines
Mar 16th
One of the primary issues that developers avoid is code repetition, especially when more that 3 instances exist. When developing I follow the guidelines best explained by:
If you do it more than 3 times, functionalise. If you do it more than 10 times, refactor.
My most recent project is built using the CodeIgniter (CI) framework which I was extremely impressed with. The level of abstraction and ability to extend makes CI a very appealing solution to any developer.