A ZSH theme optimized for people who use:
- Solarized
- Git
- Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)
For Mac users, I highly recommend iTerm 2 + Solarized Dark
<?for(;$i++<100;)echo $i%15?$i%5?$i%3?$i:Fizz:Buzz:FizzBuzz," | |
"; |
<?php | |
$matrix = array( | |
array('a', 1, 2), | |
array('b', 3, 4), | |
array('c', 5, 6), | |
array('d', 7, 8) | |
); | |
$transpose = array_reduce( | |
$matrix, |
<?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 { |
<?php | |
/** | |
* Set global/skip_process_modules_updates to '1' in app/etc/local.xml and | |
* then use this script to apply updates and refresh the config cache without | |
* causing a stampede on the config cache. | |
* | |
* @author Colin Mollenhour | |
*/ | |
umask(0); | |
ini_set('memory_limit','512M'); |
<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> |
var ALPHA = 'abcdefghijklmnopqrstuvwxyz', | |
ALPHA_UPPER = ALPHA.toUpperCase(), | |
NUMERIC = '0123456789', | |
PUNCTUATION = '-!@£$%^&*()[]{}\'"/?.>,<;:\\|~`€#', | |
UNDERSCORE = '_', | |
WHITESPACE = '\x20\t\n\r\f\v\xa0\u2028\u2029\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff'; // thanks Mathias! | |
var SHORTHAND_CC = { | |
'\\S': ALPHA + ALPHA_UPPER + NUMERIC + PUNCTUATION + UNDERSCORE, | |
'\\s': WHITESPACE, |
updatechromium () { | |
Platform='unknown' | |
platform='unknown' | |
unamestr=`uname` | |
case "$unamestr" in | |
('Darwin') Platform="Mac" | |
platform="mac" ;; | |
('Linux') Platform="Linux" | |
platform="linux" ;; | |
(*) if [[ $# = 2 ]] |
<?php | |
/** | |
* Drop this into the shell directory in the Magento root and run with -h to see all options. | |
*/ | |
require_once 'abstract.php'; | |
/** | |
* Fix duplicate url keys for categories and products to work with the 1.8 alpha1 CE url key constraints. |
Follow each step manually and any bugs during (resource) model instantiation will become obvious.
Since many people find model and resource model instantiation to be one of the more challenging things in Magento 1, these are all the steps Magento does to resolve the factory name to the real PHP class name.
To debug, simply follow each step manually until you find a non-match. This works really well in my experience.
Less guessing, more and faster results.
In the examples I use a factory name of "example/thing".