Skip to content

Instantly share code, notes, and snippets.

View adrian-green's full-sized avatar

Adrian Green adrian-green

View GitHub Profile
View cleanCache.php
if(file_exists('app/Mage.php')) require 'app/Mage.php';
else require '../../app/Mage.php';
// Init without cache so we get a fresh version
Mage::app('admin','store', array('global_ban_use_cache' => TRUE));
View gist:417c6fd3e538b3490017

Magento Snippets

Download extension manually using pear/mage

Pear for 1.4, mage for 1.5. File downloaded into /downloader/.cache/community/

./pear download magento-community/Shipping_Agent
./mage download community Shipping_Agent

Clear cache/reindex

adrian-green / Events fired during order submit process
Last active April 29, 2016 15:38
Main events fired during one-page checkout in Magento
View Events fired during order submit process
### Events during order submit process
function switch_files {
mv $1.png $1.tmp.png
mv $1-inverse.png $1.png
mv $1.tmp.png $1-inverse.png
mv $1@2x.png $1@2x.tmp.png
mv $1-inverse@2x.png $1@2x.png
mv $1@2x.tmp.png $1-inverse@2x.png
View gist:de7c70a8ff4de78dcca6
# First, enable SSH in the Administration->System tab.
# Then log in to the device.
# Verify that https_crt_save is off
admin@RT-N66U:/tmp/home/root# nvram get https_crt_save
# Enable https_crt_save and verify that it was set correctly
admin@RT-N66U:/tmp/home/root# nvram set https_crt_save=1
admin@RT-N66U:/tmp/home/root# nvram get https_crt_save
View gist:bd6fe69bef38c545ee49
* Abstract rule condition based on properties
abstract class EcomDev_Rule_Model_Rule_Condition_Abstract extends Mage_Rule_Model_Condition_Abstract
protected $_properties = null;
* Should return a label of the current condition
adrian-green /
Last active August 29, 2015 14:26 — forked from terminalfool/
A BIND ad filter refresh script. Loads ad domains from adblock plus filters
use strict;
use Proc::Simple;
use Proc::Killall;
use Time::localtime;
use LWP::Simple qw($ua getstore);
use Mozilla::CA;
View SupportDesk_FixAcl.php
* SupportDesk_FixAcl.php v1.1
* SupportDesk (
* 10/7/2015
* This source file is subject to the Open Software License (OSL 3.0)
* It is available through the world-wide-web at this URL: