Andrew McCombe


Full stack website developer

How to backup and restore with Magento 2

Magento 2 comes with built-in functionality to backup and restore the code, media, and database. You can choose to backup and restore code, media, or database separately. Here’s how to backup and restore with Magento 2.


Product and Breadcrumb Rich Snippets in Magento

Here’s how to add products and breadcrumb Rich Snippets in Magento.


Magento Snippet: How to set and get cookies in Magento

Here’s how to set and get cookies in Magento: Set: Mage::getSingleton(‘core/cookie’)->set( ‘cookieName’, ‘cookie value;, time() + (10 * 365 * 24 * 60 * 60), ‘/’ ); Get: Mage::getSingleton(‘core/cookie’)->get(‘cookieName’); // will return the cookie value or false/null Delete: Mage::getSingleton(‘core/cookie’)->delete(‘cookieName’);


Solved: PHP Imagick ‘unable to open image’ PDF

I’ve recently stumbled across an issue where PHP Imagick can’t open a PDF file despite the file being there and readable. This is using Mac OSX El Capitan with Homebrewed PHP5, Imagemagick, Ghostscript and the PHP55-imagick module. After a bit of searching I found the fix.


Magento Snippet: Admin grid currency type with currency symbol

Here’s a snippet for using a currency column type with the currency symbol prefix in Magento admin grids.


My Current Podcasts

Like many web professionals, I listen to a lot of podcasts when I have the time. They generally fall into two categories which cover my interests; tech and music, and so I thought I’d list my current podcasts in case anyone else found them interesting.


TIL: MySQL FLUSH PRIVILEGES isn’t needed

Today I learned that `FLUSH PRIVILEGES` isn’t needed by Scott Lindsey in the comments. After double checking locally that Scott was correct I looked it up and found a great explanation why MySQL FLUSH PRIVILEGES isn’t needed


MySQL fix: Field ‘xxxx’ doesn’t have a default value

I’ve recently been working on a few of our older websites with newer MySQL installations and am coming across the following error:

SQLSTATE[HY000]: General error: 1364 Field ‘delivery_address_id’ doesn’t have a default value

This is caused by MySQL having a strict mode set which won’t allow INSERT or UPDATE commands with empty fields where the schema doesn’t have a default value set.
There are a couple of fixes for this.


20 years of PHP #20yearsofphp

On 8th June 1995, Rasmus Lerdorf announced the release of Personal Home Page Tools Version 1.0. To celebrate the 20th anniversary, Ben Ramsey has asked the PHP community to share their PHP experiences and share them on Twitter using the hashtag #20yearsofphp.

Here’s my story.


Useful Oh-My-Zsh plugins

Oh-My-Zsh describes itself as a ‘community driven framework for managing your zsh configuration’ and comes with lots of zsh plugins (189 currently) but none are enabled by default. Some zsh plugins are tailored for your specific operating system whilst others are aimed at helping improve developers workflow. Wether you’re using Ruby, Python, PHP or Javascript as your main language or you’re a systems administrator, there will be a plugin to help. Here are the zsh plugins I’m currently using.