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; | |
| -- reset customers | |
| TRUNCATE `customer_address_entity`; | |
| TRUNCATE `customer_address_entity_datetime`; | |
| TRUNCATE `customer_address_entity_decimal`; | |
| TRUNCATE `customer_address_entity_int`; | |
| TRUNCATE `customer_address_entity_text`; | |
| TRUNCATE `customer_address_entity_varchar`; | |
| TRUNCATE `customer_entity`; | |
| TRUNCATE `customer_entity_datetime`; |
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; | |
| TRUNCATE `sales_flat_creditmemo`; | |
| TRUNCATE `sales_flat_creditmemo_comment`; | |
| TRUNCATE `sales_flat_creditmemo_grid`; | |
| TRUNCATE `sales_flat_creditmemo_item`; | |
| TRUNCATE `sales_flat_invoice`; | |
| TRUNCATE `sales_flat_invoice_comment`; | |
| TRUNCATE `sales_flat_invoice_grid`; | |
| TRUNCATE `sales_flat_invoice_item`; | |
| TRUNCATE `sales_flat_order`; |
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
| #!/bin/bash | |
| find . -type d -exec chmod 755 {} \; | |
| find . -type f -exec chmod 644 {} \; | |
| chmod 744 cron.sh | |
| chmod 744 mage |
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
| NSString *string = @"Hello Bla Bla"; | |
| NSString *searchText = @"bla"; | |
| NSUInteger searchOptions = NSCaseInsensitiveSearch | NSDiacriticInsensitiveSearch; | |
| NSRange searchRange = NSMakeRange(0, string.length); | |
| NSRange foundRange = [string rangeOfString:searchText options:searchOptions range:searchRange]; | |
| if (foundRange.length > 0) { | |
| NSLog(@"Text Found."); | |
| } |
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
| // NSMutableArray Example | |
| // Using this method will sort your current array | |
| NSMutableArray *unsortedArray = [[NSMutableArray alloc] initWithObjects:@"Albert", @"Eric", @"Betty", nil]; | |
| [unsortedArray addObject:@"Carl"]; | |
| [unsortedArray addObject:@"David"]; | |
| [unsortedArray sortUsingSelector:@selector(localizedCaseInsensitiveCompare:)]; | |
| NSLog(@"sorted array: %@", unsortedArray); | |
| // NSArray Example | |
| // Using this method will create a new 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 | |
| $category = Mage::getModel('catalog/category'); | |
| $categories = $category->getCategories(62, 1, true); | |
| foreach ($categories as $_category) { | |
| echo $_category->getName() ; | |
| } |
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
| #Apache >=2.4 | |
| <Directory /path/to/webroot> | |
| AllowOverride All | |
| AuthUserFile /etc/apache2/.htpasswd | |
| AuthType Basic | |
| AuthName "Restricted Content" | |
| <Limit GET> | |
| Require valid-user | |
| </Limit> |
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 Ifuel_Cache_Block_Catalog_Category_View extends Mage_Catalog_Block_Category_View | |
| { | |
| protected function _construct() | |
| { | |
| $this->addData(array( | |
| // Long term block | |
| 'cache_lifetime' => 999999999, | |
| 'cache_tags' => array(Mage_Catalog_Model_Product::CACHE_TAG, Mage_Catalog_Model_Category::CACHE_TAG), | |
| )); |
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 Ifuel_Successtest_IndexController extends Mage_Core_Controller_Front_Action | |
| { | |
| /** | |
| * Success page redirect | |
| */ | |
| public function testAction() | |
| { | |
| if (!Mage::helper('core')->isDevAllowed()) { | |
| $this->_forward('noroute'); |
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 | |
| if (!$session->getLastSuccessQuoteId()) { | |
| $this->_redirect('checkout/cart'); | |
| return; | |
| } | |
| $lastQuoteId = $session->getLastQuoteId(); | |
| $lastOrderId = $session->getLastOrderId(); | |
| $lastRecurringProfiles = $session->getLastRecurringProfileIds(); | |
| if (!$lastQuoteId || (!$lastOrderId && empty($lastRecurringProfiles))) { |