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
echo ceil((7/0)*100); // Warning: Division by zero | |
echo "\n\n"; | |
echo "no Warning:) \n", ceil(@(7/0)*100); |
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
$zendDate = Mage::app()->getLocale()->date(); | |
$zendDate->toString(Varien_Date::DATETIME_INTERNAL_FORMAT); | |
$zendDate->sub('30',Zend_Date::MINUTE_SHORT)->toString(Varien_Date::DATETIME_INTERNAL_FORMAT); |
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
запись в базу нативным sql-ом | |
$writeConnection = Mage::getSingleton('core/resource')->getConnection('core_write'); | |
$table = $resource->getTableName('catalog/product'); | |
$currentTime = date('Y-m-d H:i:s', time()); | |
$query = "UPDATE {$table} SET column = column + 1 WHERE updated_at = {$currentTime}"; | |
$writeConnection->query($query); |
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
git fetch --tags | |
git tag | |
git tag -a v1.0.52 -m 'Commit description' | |
git push origin v1.0.52 | |
then on stage repository: | |
git branch stage | |
git pull origin stage | |
then change composer.json (set new version for package) |
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
$mageRunCode = 'shopAlias'; |
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
<?xml version="1.0"?> | |
<!-- | |
/** | |
* Magento | |
* | |
* NOTICE OF LICENSE | |
* | |
* This source file is subject to the Academic Free License (AFL 3.0) | |
* that is bundled with this package in the file LICENSE_AFL.txt. | |
* It is also available through the world-wide-web at this URL: |
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
Use the -f option to git tag: | |
-f | |
--force | |
Replace an existing tag with the given name (instead of failing) | |
You probably want to use -f in conjunction with -a to force-create an annotated tag instead of a non-annotated one. | |
Example |
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
$conditions = array(); | |
$words = preg_split( "/([ ]+|[-]+|[_]+)/", $value); | |
foreach( $words as $value ){ | |
$conditions[] = array('like' => "%{$value}%"); | |
} | |
$paymentTableName = Mage::getSingleton('core/resource')->getTableName('sales/order_payment'); | |
$this->getCollection()->addFieldToFilter( | |
"{$paymentTableName}.method", | |
array('like' => "%{$value}%") |
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
$name = 'Кириллица вместе с utf-8'; | |
$name = iconv("windows-1251", "utf-8", $name); | |
$name = str_replace('Кириллица', '', $name); |
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
$fileHeaders = @get_headers($imgUrl); | |
if($fileHeaders[0] == 'HTTP/1.1 200 OK') { | |
echo 'image exists'; | |
} |