Skip to content

Instantly share code, notes, and snippets.

View philwinkle's full-sized avatar

Phillip Jackson philwinkle

  • West Palm Beach, FL
View GitHub Profile
ytp923p92gjp923galkjew;klajsd;lgjasl;dgjjzij;lkj;lkjl;;¬…¬˚¬˚∆˚∆∆¬∆…øˆp;.lojmu•ºª•¨ª¨¨øˆø¨øjjklła ?:>l,./;;l,kmjn mk,bvhn098765tr4890p8iu7t5r4ety67890-=0p9sgw32g23g /'/
<?php
/**
* Magento version/edition helper for determining the Magento BASE version (regardless of edition) and adds functions to check if Enterprise, Professional or Community are being run.
* Adds isMageCommunity(), isMageProfessional() and isMageEnterprise()
*
* @category TBT
* @package TBT_Rewards
* @author WDCA Sweet Tooth Team <[email protected]>
*/
class TBT_Rewards_Helper_Version extends Mage_Core_Helper_Abstract {
<action type="dataflow/convert_parser_csv" method="parse">
<var name="delimiter"><![CDATA[,]]></var>
<var name="enclose"><![CDATA[]]></var>
<var name="fieldnames"></var>
<var name="map">
<map name="sku"><![CDATA[sku]]></map>
<map name="image"><![CDATA[image]]></map>
<map name="image_label"><![CDATA[image_label]]></map>
<map name="small_image"><![CDATA[small_image]]></map>
<map name="small_image_label"><![CDATA[small_image_label]]></map>
#!/usr/bin/env php
<?php
//
// PHP REPL with initialized Magento environment
//
// Thanks to https://github.com/d11wtq/boris
//
// Drop this script in your $PATH and run it anywhere in a Magento directory tree to start the REPL
//
@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) {
alias sshkey="cat ~/.ssh/id_rsa.pub | pbcopy && echo 'Copied to clipboard.'"
<?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
# 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.
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 }