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 | |
$certificateCAcer = '/certificate.cer'; | |
$certificateCAcerContent = file_get_contents($certificateCAcer); | |
/* Convert .cer to .pem, cURL uses .pem */ | |
$certificateCApemContent = '-----BEGIN CERTIFICATE-----'.PHP_EOL | |
.chunk_split(base64_encode($certificateCAcerContent), 64, PHP_EOL) | |
.'-----END CERTIFICATE-----'.PHP_EOL; |
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 | |
/** | |
* @author Branko Ajzele <ajzele@gmail.com, http://foggyline.net> | |
*/ | |
$XMLRequestType = 'RacunZahtjev'; /* RacunZahtjev OR PoslovniProstorZahtjev */ | |
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 | |
require_once 'app/Mage.php'; | |
Mage::app(); | |
$quote = Mage::getModel('sales/quote') | |
->setStoreId(Mage::app()->getStore('default')->getId()); | |
$product = Mage::getModel('catalog/product')->load(6); /* 6 => Some product ID */ |
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
#!/usr/bin/php | |
<?php | |
/** | |
* Loto (random) number generator. | |
* | |
* Script accepts 3 params. | |
* First two are to determine the type of loto, for example 7 of 39, or 6 of 45. | |
* Third parameter is the number of combinations. | |
* | |
* By default it 7 of 39 and one combination. |
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
find pub/media/catalog/product -depth -name '* *' -type f | while IFS= read -r f ; do mv -i "$f" "$(dirname "$f")/$(basename "$f"|tr ' ' _)" ; done |
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
warden env exec -- -T php-fpm bin/magento setup:install \ | |
--cleanup-database \ | |
--backend-frontname=backend \ | |
--amqp-host=rabbitmq \ | |
--amqp-port=5672 \ | |
--amqp-user=guest \ | |
--amqp-password=guest \ | |
--consumers-wait-for-messages=0 \ | |
--db-host=db \ | |
--db-name=magento \ |
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 (($referrer = Mage::app()->getRequest()->getServer('HTTP_REFERER'))): ?> | |
<?php $storeUrlParts = parse_url(Mage::getBaseUrl(Mage_Core_Model_Store::URL_TYPE_WEB)); ?> | |
<?php $referrerUrlParts = parse_url($referrer); ?> | |
<?php if ($storeUrlParts['host'] === $referrerUrlParts['host']): ?> | |
<button type="button" title="<?php echo $this->__('Go back to %s', $referrer) ?>" class="button" onclick="this.innerHTML = '<?php echo $this->__('Redirecting...') ?>'; window.location = '<?php echo $referrer ?>';"><?php echo $this->__('Back') ?></button> | |
<?php endif; ?> | |
<?php endif; ?> |
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 | |
/** | |
* @author Branko Ajzele <ajzele@gmail.com> | |
*/ | |
class Inchoo_Extension_Helper_Gmap extends Mage_Core_Helper_Abstract | |
{ | |
const GOOGLE_MAPS_HOST = 'maps.google.com'; | |
const CONFIG_PATH_GOOGLE_MAPS_API_KEY = 'inchoo_google/maps/api_key'; | |
public function getGoogleMapsApiKey() |
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
import Foundation | |
extension UnicodeScalar : ForwardIndexType { | |
public func successor() -> UnicodeScalar { | |
return UnicodeScalar(value + 1) | |
} | |
} | |
var operatorHeads: [UnicodeScalar] = Array("=-+!*%<>&|^~?".unicodeScalars) | |
operatorHeads += Array("\u{00A1}" ... "\u{00A7}") |
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
version: '3' | |
services: | |
mysql: | |
image: mysql:5.7 | |
volumes: | |
- mysql_data:/var/lib/mysql | |
restart: always | |
ports: | |
- "3306:3306" |
NewerOlder