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'; | |
try { | |
Mage::app(); | |
echo gethostname(); | |
} Catch (Exception $e) { | |
header("HTTP/1.0 503 Service Unavailable"); | |
} |
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
/* iPhone 3 portrait */ | |
@media (device-height: 480px) and (-webkit-max-device-pixel-ratio: 1) and (orientation:portrait) { | |
} | |
/* iPhone 3 landscape */ | |
@media (device-height: 480px) and (-webkit-max-device-pixel-ratio: 1) and (orientation:landscape) { | |
} | |
/* iPhone 4 retina portrait */ | |
@media (device-height: 480px) and (-webkit-min-device-pixel-ratio: 2) and (orientation:portrait) { |
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
/* iPhone 3 portrait */ | |
@media (device-height: 480px) and (-webkit-max-device-pixel-ratio: 1) and (orientation:portrait) { | |
} | |
/* iPhone 3 landscape */ | |
@media (device-height: 480px) and (-webkit-max-device-pixel-ratio: 1) and (orientation:landscape) { | |
} | |
/* iPhone 4 retina portrait */ | |
@media (device-height: 480px) and (-webkit-min-device-pixel-ratio: 2) and (orientation:portrait) { |
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 | |
if (!$session->getLastSuccessQuoteId()) { | |
$this->_redirect('checkout/cart'); | |
return; | |
} | |
$lastQuoteId = $session->getLastQuoteId(); | |
$lastOrderId = $session->getLastOrderId(); | |
$lastRecurringProfiles = $session->getLastRecurringProfileIds(); | |
if (!$lastQuoteId || (!$lastOrderId && empty($lastRecurringProfiles))) { |
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 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 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 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 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 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 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."); | |
} |
OlderNewer