Skip to content

Instantly share code, notes, and snippets.

By responding to this email you acknowledge and accept that a fee will be charged to you in order to deal with your response.
This fee will include time spent to read your reply, research, action, and then respond to your reply.
The minimal chargeable amount is £100.00. After the 1st hour, the fee is pro-rata at the same rate in 15 minute intervals.
Fees must be paid within 7 days of recieving invoice. Late payment will incur interest at an annual rate of 8% until settlement.
@leesbian
leesbian / gist:0324f8b85787a7c0eecd90fa846408bb
Created November 1, 2016 17:49
How not to bootstrap Magento
// ...
// Regular index.php stuff above here
// default site
$mage_run_code = 'base';
$currentzone = 'UK';
$geo_country_code = 'GB';
if(isset($_SERVER['HTTP_X_STORE'])) {
$currentzone = $_SERVER['HTTP_X_STORE'];
$geo_country_code = $_SERVER['HTTP_X_STORE'];
@leesbian
leesbian / Zend_Validate_Xml.php
Created April 26, 2012 12:55
an XML validator for Zend_Validate, because... there isn't one
<?php
/**
* @see Zend_Validate_Abstract
*/
#require_once 'Zend/Validate/Abstract.php';
/**
* @category Zend
* @package Zend_Validate
@leesbian
leesbian / gist:1854374
Created February 17, 2012 17:02
Remove quotes that belong to anonymous users with expired cookies (because they'll never be able to retrieve them)
/**
* Clean expired quotes (cron process)
*
* @param Mage_Cron_Model_Schedule $schedule
* @return Mage_Sales_Model_Observer
*/
public function cleanExpiredQuotes($schedule)
{
Mage::dispatchEvent('clear_expired_quotes_before', array('sales_observer' => $this));
@leesbian
leesbian / magento-db-stats
Created November 3, 2011 20:09
See what your Magento database is doing...
mysqlbinlog mysql-bin-log* | grep -i -e "^update" -e "^insert" -e "^delete" -e "^replace" -e "^alter" | cut -c1-100 | tr '[A-Z]' '[a-z]' | sed -e "s/\t/ /g;s/\`//g;s/(.*$//;s/ set .*$//;s/ as .*$//" | sed -e "s/ where .*$//" | sort | uniq -c | sort -nr