Skip to content

Instantly share code, notes, and snippets.

View adrian-green's full-sized avatar

Adrian Green adrian-green

View GitHub Profile
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));

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
### 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
# 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
* 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;
* 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: