This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript:(function(){var kittens=function(){for(var b=document.images,a=0;a<b.length;a++){var c=b[a].width,d=b[a].height;if(c&&d)b[a].src='http://placekitten.com/'+c+'/'+d}return false};kittens();})() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
watch 'php -r '"'"'$m=new Memcache;$m->connect("127.0.0.1", 11211);print_r($m->getstats());'"'" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$database_host = "localhost"; | |
$database_user = "username"; | |
$database_password = "password"; | |
$magento_database = "databasename"; | |
$table_prefix = "prefixhere_"; | |
$dryrun = true; // change to false when you want to commit changes | |
$db = mysql_connect($database_host, $database_user, $database_password); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET FOREIGN_KEY_CHECKS = 0; | |
SET GROUP_CONCAT_MAX_LEN=32768; | |
SET @tables = NULL; | |
SELECT GROUP_CONCAT('`', table_name, '`') INTO @tables | |
FROM information_schema.tables | |
WHERE table_schema = (SELECT DATABASE()); | |
SELECT IFNULL(@tables,'dummy') INTO @tables; | |
SET @tables = CONCAT('DROP TABLE IF EXISTS ', @tables); | |
PREPARE stmt FROM @tables; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected function _getIndexers() | |
{ | |
return Mage::getSingleton('index/indexer')->getProcessesCollection(); | |
} | |
protected function _stopReindex() | |
{ | |
$this->_getIndexers()->walk('setMode', array(Mage_Index_Model_Process::MODE_MANUAL)); | |
$this->_getIndexers()->walk('save'); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require_once('app/Mage.php'); | |
ob_implicit_flush(true); | |
umask(0); | |
set_time_limit(0); | |
ini_set('display_errors', 1); | |
Mage::app(); | |
Mage::setIsDeveloperMode(true); | |
Mage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Save an PHP Array to disk with a delimiter to support | |
* multiple array values. Associative Array supported. | |
* | |
* @author Jared Blalock ([email protected]) | |
* @link http://molotovbliss.com | |
*/ | |
Class Json_Array { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// drop into Magento root directory updateprice.php and execute | |
require_once('app/Mage.php'); | |
ob_implicit_flush(true); | |
umask(0); | |
set_time_limit(0); | |
ini_set('display_errors', 1); | |
ini_set('memory_limit', '2048M'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Source: https://magento.stackexchange.com/questions/95/debugging-layout-xml-loading | |
You can log the compiled layout XML directives which are used to generate blocks. Create an observer on controller_action_layout_generate_blocks_before, and in the observer method log the update XML from the transported layout object: | |
public function logCompiledLayout($o) | |
{ | |
$req = Mage::app()->getRequest(); | |
$info = sprintf( | |
"\nRequest: %s\nFull Action Name: %s_%s_%s\nHandles:\n\t%s\nUpdate XML:\n%s", | |
$req->getRouteName(), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Get Collection | |
$collection = Mage::getModel('catalog/product')->getCollection() | |
->addAttributeToSelect('sku') | |
->addAttributeToSelect('publihser') | |
->addFieldToFilter(array(array('attribute'=>'publisher','eq'=>$publisher))); | |
function productUpdateCallback($args){ | |
$product = Mage::getModel('catalog/product'); | |
$product->setData($args['row']); | |
$productId = $product->getId(); |