This file contains 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 | |
$code = 'color'; | |
$opts = Mage::getSingleton('eav/config') | |
->getAttribute('catalog_product', $code) | |
->getSource() | |
->getAllOptions(false); | |
foreach($opts as $opt) { |
This file contains 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 | |
$range = array_merge(range('a', 'z'), range('A', 'Z'), range(0, 9), array('_')); | |
foreach ($range as $a) foreach ($range as $b) mkdir("$a/$b", 0777, true); | |
$db = new PDO('mysql:127.0.0.1;dbname=magento', 'root', 'root'); | |
//$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING); | |
$result = $db->query('select distinct value from catalog_product_entity_media_gallery'); |
This file contains 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
[xdebug] | |
xdebug.default_enable=1 | |
xdebug.remote_enable=1 | |
xdebug.remote_handler=dbgp | |
xdebug.remote_host=localhost | |
xdebug.remote_port=9000 | |
xdebug.remote_autostart=1 | |
xdebug.profiler_enable_trigger=1 | |
zend_extension="/Applications/MAMP/bin/php/php5.5.3/lib/php/extensions/no-debug-non-zts-20121212/xdebug.so" |
This file contains 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 | |
class Paypal | |
{ | |
/** | |
* API Version | |
*/ | |
const VERSION = 51.0; | |
/** |
This file contains 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
#!/bin/bash | |
################################################################################ | |
# FUNCTIONS | |
################################################################################ | |
# 1. Check required system tools | |
_check_installed_tools() { | |
local missed="" |
This file contains 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 | |
final class Mage | |
{ | |
// ... | |
public static function dispatchEvent($name, array $data = array()) | |
{ | |
$e = new Exception(); | |
Mage::log( | |
$name . ': ' . implode(', ', array_keys($data)) . "\n" |
This file contains 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-Content dump.sql | Foreach-Object { $_ -replace 'DEFINER(.*)`magento-dbuser`@`localhost`','DEFINER$1`different-user`@`different-host`' } | Set-Content new.sql |
This file contains 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 | |
include 'app/Mage.php'; | |
Mage::app('admin', 'store'); | |
$password = substr(md5('Password' . time()), 0, 16); | |
$user = Mage::getModel("admin/user") | |
->setData(array( | |
'username' => 'steve', |
This file contains 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 @DATABASE = 'prod'; | |
SELECT CONCAT(table_schema, '.', table_name), | |
CONCAT(ROUND(table_rows / 1000000, 2), 'M') rows, | |
CONCAT(ROUND(data_length / ( 1024 * 1024 * 1024 ), 2), 'G') DATA, | |
CONCAT(ROUND(index_length / ( 1024 * 1024 * 1024 ), 2), 'G') idx, | |
CONCAT(ROUND(( data_length + index_length ) / ( 1024 * 1024 * 1024 ), 2), 'G') total_size, | |
ROUND(index_length / data_length, 2) idxfrac | |
FROM information_schema.TABLES | |
WHERE `information_schema`.TABLES.table_schema = @DATABASE |
This file contains 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
#!/bin/bash | |
################################################################################ | |
# FUNCTIONS | |
################################################################################ | |
# 1. Check required system tools | |
_check_installed_tools() { | |
local missed="" |