Quickshiftin - Clever Crazy Code

Using traits in Magento

March 14th, 2015

So I’ve finally started using Magento and on the whole I’m enjoying it. Magento is very flexible and the code is fairly clean. Some of the nomenclature is misleading and comments can be scant, but it’s still way cleaner than most of the older PHP e-commerce systems I’ve used like Virtuemart, OpenCart, ZenCart etc. As I’ve begun building modules to customize Magento, I discovered Alan Storm’s great website and purchased his e-book No Frills Magento Layout. I’ve also been enjoying PHP’s trait feature, you may remember I recently posted on traits too. Trait’s are useful in Magento, I’ll show you how I’m using them already.

More »

BASH vs ‘Proper’ scripting languages

December 17th, 2014

Lately I’ve had the chance to dive much deeper into BASH than I ever have before. I’m working on a build system with a dozen or so library files, and as many client scripts for the actual builds. A big question is whether or not BASH is the best language for the system compared to scripting options like Python, Perl, Ruby, PHP >cough<, etc. Initially I wrote the entire build system in BASH. But given an opportunity to learn Python, and put the theory to the test, I decided to start implementing some of the components in Python to see what it could offer.

More »

PHP traits in the real world

November 29th, 2014

I started dabbling with traits in PHP back when they were under development in 2010. It’s a little surprising then that I’ve just barely come round to actually using them in a project. Seems like PHP 5.3 has been so solid there’s been little need to upgrade, now I’m making the jump from 5.3 straight to 5.5 on a lot of my servers. Anyway, now that I’m rolling out servers with PHP 5.5 traits are on the table. Rather than regurgitating some Hello World example, I’ll illustrate a practial example from my new Softwear codebase and show how traits can save us from carpel tunnel syndrome we contracted before their advent.

More »

CSV handling lacking in PHP

November 6th, 2014

If you’ve had to deal with CSV files programmatically I feel your pain. CSV files are one of those hideous remnants of some old world of computer processing that has somehow clung to life in the midst of superior formats like XML and JSON. So when it comes to working with CSV files as a programmer I’m already put out just to be dealing with them at all. To make matters worse I’ve found the standard functions to work with CSV’s in PHP lacking, see what you think and feel free to share feedback!

More »

Ebay’s BIG problem with hacked accounts

October 1st, 2014

If you’re like me, you’re probably like the many millions of folks out there who only sell something on ebay once in a blue moon. Recently I decided to buy a new laptop and wanted to sell my perfectly good old laptop. I’ve sold things on ebay in the past, I have friends that have sold things on ebay in recent history, frankly it seems like the natural choice to make such a sale. I’m here to tell you that couldn’t be any further from reality!

More »