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 shell/log.php clean |
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 | |
| class Observer { | |
| public function load_customer_quote_before($observer) | |
| { | |
| $checkout_session = $observer->getEvent()->getCheckoutSession(); | |
| if($checkout_session->getQuote()->getItemsCount() < 1) // check if current quote has items | |
| { | |
| return $this; | |
| } | |
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
| class SampleController | |
| extends Mage_Core_Controller_Front_Action | |
| { | |
| public function indexAction() | |
| { | |
| $this->loadLayout($this->getFullActionName()); | |
| $this->renderLayout(); | |
| } | |
| } |
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 | |
| /** | |
| * @see http://www.johannreinke.com/en/2012/04/13/magento-how-to-cache-product-loading/ | |
| */ | |
| class Namespace_Catalog_Model_Product | |
| extends Mage_Catalog_Model_Product | |
| { | |
| public function load($id, $field = null) |
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 | |
| class Something_Asdf_Model_Resource_Halma_Collection | |
| extends Mage_Core_Model_Resource_Db_Collection_Abstract | |
| { | |
| /** | |
| * delete all the entities in the collection | |
| * | |
| * @return $this | |
| */ | |
| public function delete() |
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
| */5 * * * * root /usr/local/bin/dyndns.sh > /dev/null |
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
| curl --silent http://example.com/sitemap.xml | xpath -q -e "/urlset/url/loc/text()" > tmp.urls && siege -v -c 1 -r `cat tmp.urls | wc -l` -f tmp.urls |
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 | |
| // BOF: Config | |
| // Syntax have to be "http(s)://something.com/" | |
| // Slash at the End is required | |
| $http = "http://www.example.com/"; | |
| $https = "https://www.example.com/"; | |
| // EOF: Config | |
| /* Magento Move Shop */ |
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
| -- little helper function | |
| function file_exists(path, ftype) | |
| local attr = lighty.stat(path) | |
| return (attr and attr[ftype]) | |
| end | |
| function check_path(path) | |
| local rv = path | |
| if (not file_exists(path, "is_file")) then | |
| rv = nil |
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
| location /api { | |
| rewrite ^/api/rest /api.php?type=rest last; | |
| rewrite ^/api/v2_soap /api.php?type=v2_soap last; | |
| rewrite ^/api/soap /api.php?type=soap last; | |
| } |