One of the organisations I work for makes heavy use of Google Apps such as Drive & Spreadsheet. They wanted the ability to upload/import a CSV file, perform automated operations on the data and finally spit out the result into a Google Spreadsheet. I built the text/csv file import facility by using the FileReader API. Essentially we read the file…
Increase verbosity
I saw something like this today: I couldn’t find anything in the manual or help about the dash-triple-v option other than the dash-v which enables verbose output. Turns out that by adding an extra v or two you’re increasing the verbosity of the output. Increase the verbosity I say!
Gotcha: MySQL decimal type vs PostgreSQL decimal type
I encountered this issue in a Rails app where I had my local development DB set as PostgreSQL and my staging set as MySQL. A big no-no, I should have known better. On my staging environment, when I was saving a number such as 99.99 into the decimal field the result was 99. I was losing the fractional part! Essentially,…
Wget – Resume download
Ever use wget to download a file only to have it stop midway? Resume the download using the -c or –continue switch:
Magento: getOrderId() deprecated
After Magento CE 1.4.0.1, Mage_Checkout_Block_Onepage_Success::getOrderId() has been deprecated. Need to get the order id? Don’t bother looking for getLastRealOrderId() as it uses Magento’s magical (or not so magical) getter/setter. More about that here: http://codegento.com/2011/02/where-are-my-getters-and-setters/
Magento: One site, multiple domains
A client recently wanted 2 domains resolving to the same Magento instance. This is typically discouraged due to SEO concerns of duplicate data/information but I digress. Depending on your DNS management, you’d probably “park” the 2nd domain over the primary domain… done and dusted. Unfortunately, it’s not that simple with Magento due to its robust multi-site and URL rewriting system.…
Magento Cron Debugging with XDebug and PHPStorm
I recently needed to debug some Magento code from both the command line and stuff executed by cron. Inserting Mage::log() here and there wasn’t exactly efficient or satisfying. I’ve always used XDebug with PHPStorm (which I use solely for debugging) but all code was always executed within the browser. Long story short, if you want to debug code in the…
Than vs Then : The ultimate trick
Can you replace the th(a|e)n with “and then”? If your answer is yes, it’s THEN. If your answer is no, it’s THAN. You’re welcome!
Installing a Magento extension on a Mac: Merging files and folders
In order to install a Magento extension, the first step is usually to add the required files and folders to your current Magento installation. This can be a real pain on a Mac since its merge utility is rudimentary at best. This is where rsync (which is available from the command line) comes in handy. Common options -a archive mode…
Learning Ember.js: A Journey
I’ve got this tendency to work on ambitious projects. I think it’s a good way to get extra value from a project. If I can learn something new while developing a website or application, I see that as an earn! Of course it doesn’t always lead to speedy results and every extra hour I work drives down my hourly earn……