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 | |
use Magento\Framework\App\Bootstrap; | |
require __DIR__ . '/app/bootstrap.php'; | |
$bootstrap = Bootstrap::create(BP, $_SERVER); | |
$objectManager = $bootstrap->getObjectManager(); | |
$state = $objectManager->get('Magento\Framework\App\State'); | |
$state->setAreaCode('frontend'); |
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 my_class { | |
private $_timerId = []; | |
private function startTimer($timerId) { | |
$this->_timerId[$timerId]['start'] = microtime(true); | |
} | |
private function stopTimer($timerId) { |
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
select | |
count(*) addresses, | |
ce.entity_id, | |
from customer_address_entity cae | |
join customer_entity ce ON cae.parent_id = ce.entity_id | |
where ce.is_active = 1 | |
and cae.city = '' | |
group by ce.entity_id | |
having addresses > 2 -- delete this line, if you also want to show customers that have only one address |
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 | |
/** | |
* Sets different values for an attribute, depending on the store. | |
* | |
* This example sets the hs code attribute of product 123 to 111111 for the UK and 222222 for AU. | |
*/ | |
$storeIdUK = 1; | |
$storeIdAU = 2; |
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 ProductManager implements ProductManagerInterface | |
{ | |
/** | |
* @var \Magento\Catalog\Api\ProductRepositoryInterface | |
*/ | |
private $prodRep; | |
public function __construct() |
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
#!/bin/bash | |
# | |
# This script creates a chrooted user, scp enabled, on an Amazon Linux aws instance | |
# | |
# 2017-10-05 | |
# | |
# change username and password here: | |
username="abc" |