Skip to content

Instantly share code, notes, and snippets.

View adrian-green's full-sized avatar

Adrian Green adrian-green

View GitHub Profile

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

#!/bin/bash
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
0
# 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
adrian-green / bind_config.pl
Last active August 29, 2015 14:26 — forked from terminalfool/bind_config.pl
A BIND ad filter refresh script. Loads ad domains from adblock plus filters
#!/usr/bin/perl
use strict;
use Proc::Simple;
use Proc::Killall;
use Time::localtime;
use LWP::Simple qw($ua getstore);
$ua->agent("");
use Mozilla::CA;
<?php
umask(0);
ini_set('memory_limit','512M');
set_time_limit(0);
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));
<?php
/**
* SupportDesk_FixAcl.php v1.1
* SupportDesk (www.supportdesk.nu)
* 10/7/2015
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* It is available through the world-wide-web at this URL:
@adrian-green
adrian-green / Image.php
Last active March 21, 2016 06:52
bad code
<?php