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
$collection->load(); | |
// the following statements are equivalent | |
$collection->getSelect()->assemble(); | |
$collection->getSelect()->__toString(); | |
echo $collection->getSelect(); |
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
// To avoid problems with full page cache | |
// https://github.com/magento/magento2/blob/4d2609343a950e9ee6b50cc4444469d50d82b139/app/code/Magento/Customer/Block/Account/Customer.php#L52 | |
public function customerLoggedIn() | |
{ | |
return (bool)$this->httpContext->getValue(\Magento\Customer\Model\Context::CONTEXT_AUTH); | |
} |
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
console.dir(document.body); |
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
<referenceBlock name="top.links"> | |
<referenceBlock name="register-link" remove="true" /> | |
<!--for Create Account Link--> | |
<referenceBlock name="authorization-link" remove="true" /> | |
<!--for Sign In Link --> | |
<referenceBlock name="wish-list-link" remove="true" /> | |
<!--for WishList Link--> | |
<referenceBlock name="catalog.compare.link" remove="true" /> | |
<!--for WishList Link--> | |
<referenceBlock name="my-account-link" remove="true" /> |
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 | |
/** | |
* Copyright © Magento, Inc. All rights reserved. | |
* See COPYING.txt for license details. | |
* | |
* File: | |
* Magento_Theme/templates/html/copyright.phtml | |
*/ | |
?> | |
<small class="copyright"> |
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
var item = document.querySelector('#find-me'); | |
var prev = item.previousElementSibling; | |
var next = item.nextElementSibling; |
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
#Delete remote tag | |
git push --delete origin <tag> | |
#Move tag | |
git tag --force v1.0 <ID-of-commit-127> | |
git push --force --tags |
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 commit --amend |
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
/* Constructor */ | |
\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig | |
$this->scopeConfig = $scopeConfig | |
/* Use */ | |
$this->scopeConfig->getValue('dev/debug/template_hints', \Magento\Store\Model\ScopeInterface::SCOPE_STORE); |
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
var sandwiches = ['turkey', 'ham', 'turkey', 'tuna', 'pb&j', 'ham', 'turkey', 'tuna']; | |
var deduped = sandwiches.filter(function (sandwich, index) { | |
return sandwiches.indexOf(sandwich) === index; | |
}); | |
// Logs ["turkey", "ham", "tuna", "pb&j"] | |
console.log(deduped); |