Skip to content

Instantly share code, notes, and snippets.

delimiter ;;
drop procedure if exists build_catalog;;
create procedure build_catalog(IN categories INT, IN products INT)
begin
SET @category_count = 1;
SET @CATNAMEPREFIX = "Category ";
SET @CATURLKEYPREFIX = "cat-";
SET @CATURLPATHPREFIX = "catpath-";
SET @ROOTCATEGORY = 2;
SET @INCLUDEINMENU = 1;
explain(){ curl -s $(echo "http://explainshell.com/explain/$1?args=${@:2}" | sed -e 's/ /+/g') |
sed -n '/<pre/,/<\/pre>/p' | sed -s 's/<[^>]*>//g' | sed -e 's/^ *//g;s/ *$//g' | grep '.' | cat }
delimiter ;;
drop procedure if exists build_catalog;;
create procedure build_catalog(IN categories INT, IN products INT)
begin
SET @category_count = 1;
SET @CATNAMEPREFIX = "Category ";
SET @CATURLKEYPREFIX = "cat-";
SET @CATURLPATHPREFIX = "catpath-";
SET @ROOTCATEGORY = 2;
SET @INCLUDEINMENU = 1;
<?php
class Marty_Package_Helper_Data extends Mage_Core_Helper_Abstract
{
public function getYesnoHtml()
{
$options = Mage::getModel('adminhtml/system_config_source_yesno')->toOptionArray();
# So, you forgot to use logrotate and now you're staring at a 30GB system
# log on your production server.
# Never fear...
# Tail an arbitrarily large number of bytes off the end of the thing.
# This example takes approximately the last 5GB.
tail -c 5000000000 system.log > ~/system.log.tmp
# But, we only want the last month of log data. Let's find the line number
# where this month's reporting starts.
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Open Software License (OSL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/osl-3.0.php
alias sshkey="cat ~/.ssh/id_rsa.pub | pbcopy && echo 'Copied to clipboard.'"
@philwinkle
philwinkle / gist:6159910
Created August 5, 2013 21:48
Keyboard Cleaning 8-2013
hyreasZLOAS tyuiop0;ewqe=[]
['phn['
]'[l.:"
}p[;?.≤gbfcxcfghgcvvghcv xcvbjnbvcxhbnvc ΩcfvxzsedsazaswaASWA qasdesaAQWEWQA qwertuuhgfdsehk;'
]\\
']\\
]\]\]=]=p0[-==p0-o9i890-p0o9u7u7w2e34rq1 `12wq1 `
?
'/.;'
@philwinkle
philwinkle / day.css
Last active March 25, 2021 03:24
Day and Night CSS files for Chris Harry jQuery lesson testing in jsFiddle. For more context see http://jsfiddle.net/87Nzy/1/
body {
background-color: yellow;
color: #000;
}
@philwinkle
philwinkle / addPingdomProbesToDebugList.php
Last active December 19, 2015 18:39
Update using Zend_Feed_Rss
<?php
require_once 'app/Mage.php';
Mage::app();
$xml = new Zend_Feed_Rss('https://my.pingdom.com/probes/feed');
$debugIps = Mage::getStoreConfig('dev/restrict/allow_ips');
if($debugIps) {