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
# single folder | |
du -sh [FOLDERNAME]/ | |
# subfolders | |
du --max-depth=1 [FOLDERNAME]/ | sort -n -r |
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
// Bind a custom event to the lightbox that can be triggered when it needs to be dismissed: | |
$('.lightbox').bind('dismiss', function() { | |
// code to dismiss lightbox | |
}); | |
// Then just trigger that event when escape it pressed: | |
$(document).bind('keyup', function(e) { | |
if(e.keyCode == 27) { |
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
# http://thenerdary.net/articles/entry/htaccess-environments | |
RewriteEngine On | |
RewriteBase / | |
### SET UP ENVIORNMENTS ### | |
# Default to master | |
RewriteRule .* - [E=ENVIRONMENT:master] |
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
### IE users need a little help (Magento+IE9=bad times) ### | |
<IfModule mod_setenvif.c> | |
<IfModule mod_headers.c> | |
BrowserMatch MSIE ie | |
Header set X-UA-Compatible "IE=EmulateIE8,chrome=1" env=ie | |
</IfModule> | |
</IfModule> | |
<IfModule mod_headers.c> | |
# Because X-UA-Compatible isn't sent to non-IE (to save header bytes), | |
# We need to inform proxies that content changes based on UA |
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 | |
/** | |
* how best to turn on errors for staging subdomains | |
* | |
* as this is in the index.php, performance is important, | |
* although technically the page will be cached | |
*/ | |
// 1. preg_match | |
if (preg_match('/^s1\.|^s2\.|^s3\.|^s4\.|^s5\.|^mac\.|^local\.|^mac-upgrade\./', $_SERVER['HTTP_HOST'])) { |
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 developer mode and display_errors based on subdomain | |
*/ | |
$staging_subdomains = array( | |
's1', | |
's2', | |
's3', | |
's4', | |
's5', | |
'mac', |
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
SELECT | |
sr.`name` as rule_name, | |
count(*) as total_orders, | |
SUM(sfo.`total_paid`) as revenue, | |
sr.`rule_id`, | |
sfo.`applied_rule_ids` | |
FROM | |
`sales_flat_order` sfo, | |
`salesrule` sr | |
WHERE |
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.remote_autostart=true | |
xdebug.remote_enable=1 | |
xdebug.collect_vars=on | |
xdebug.collect_params=4 | |
xdebug.show_local_vars=on | |
xdebug.var_display_max_depth=5 | |
xdebug.show_exception_trace=on |
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 | |
$attribute_value = Mage::getResourceSingleton('catalog/product')->getAttributeRawValue($productId, 'attribute_code', Mage::app()->getStore()); | |
echo $attribute_value; |
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
# /etc/logrotate.d/magento | |
"/path/to/site/var/log/*.log" | |
"/path/to/another-site/var/log/*.log" { | |
compress | |
copytruncate | |
daily | |
missingok | |
notifempty | |
olddir archive |