svn st | grep -e '^M' | awk '{print $2}' | xargs svn revert
About Magento, Linux, Jquery, PHP ... and other!
svn st | grep -e '^M' | awk '{print $2}' | xargs svn revert
find / -name "test_*" -type d -print
ln -s /etc/apache2/sites-available/phpmyadmin.domain.net /etc/apache2/sites-enabled/phpmyadmin.domain.net
public function _getDiffInHours( $date ){
$usDate = str_replace ( "/" , "-" ,$date);
$now = strtotime("now");
$nextDate = strtotime ( $usDate );
if(! is_numeric( $nextDate ) || ! is_numeric( $now ) || $nextDate < $now ){
return 0;
}
return floor( ($nextDate-$now) / (60*60));
}
public function _log($msg){
$nameFile = 'other-file-'.date ( "Y-m-d-H" ).'.log';
Mage::log($msg, null, $nameFile );
}
public function normaliza ($string){
$a = 'ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõöøùúûýýþÿŔŕ';
$b = 'aaaaaaaceeeeiiiidnoooooouuuuybsaaaaaaaceeeeiiiidnoooooouuuyybyRr';
$string = utf8_decode($string);
$string = strtr($string, utf8_decode($a), $b);
$string = strtolower($string);
return utf8_encode($string) ;
}
Mage::app()->getLocale()->date(strtotime($Model->getCreatedAt()), null, null, false)->toString('dd/MM/yyyy')
<?php require_once 'app/Mage.php'; umask( 0 ); Mage :: app( "default" ); Mage::log("Started Rebuilding Search Index At: " . date("d/m/y h:i:s")); $sql = "truncate catalogsearch_fulltext;"; $mysqli = Mage::getSingleton('core/resource')->getConnection('core_write'); $mysqli->query($sql); $process = Mage::getModel('index/process')->load(7); $process->reindexAll(); Mage::log("Finished Rebuilding Search Index At: " . date("d/m/y h:i:s"));
$date = date("Y-m-d");// current date
$date = strtotime(date("Y-m-d", strtotime($date)) . " +1 day");
$date = strtotime(date("Y-m-d", strtotime($date)) . " +1 week");
$date = strtotime(date("Y-m-d", strtotime($date)) . " +2 week");
$date = strtotime(date("Y-m-d", strtotime($date)) . " +1 month");
$date = strtotime(date("Y-m-d", strtotime($date)) . " +30 days");
chmod go-w /var/empty/sshd;chmod go-w /var/empty
getStore()->getId();
if (Mage::app()->useCache('config') && $collection = Mage::app()->loadCache($cacheKey)) {
$prod = unserialize($collection);
} else {
$prod = Mage::getModel()->getCollection;
....
if (Mage::app()->useCache('config')) {
Mage::app()->saveCache(serialize($prod), $cacheKey, array('config'));
}
}
$stores = Mage::getModel('core/store')->getCollection();
foreach( $stores as $store ){
$url = Mage::getModel('core/url') ->setStore($store)->getUrl('');
echo $url."\n";
}
SELECT entity_id, count( * )
FROM catalog_category_flat_store_x
GROUP BY entity_id
ORDER BY count( * ) DESC
LIMIT 0 , 30
<?
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://www.new-url.com" );
?>