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
<?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
<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
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
// 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
$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
/*! | |
* Check if an element is out of the viewport | |
* (c) 2018 Chris Ferdinandi, MIT License, https://gomakethings.com | |
* @param {Node} elem The element to check | |
* @return {Object} A set of booleans for each side of the element | |
*/ | |
var isOutOfViewport = function (elem) { | |
// Get element's bounding | |
var bounding = elem.getBoundingClientRect(); |
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
/** | |
* Randomly shuffle an array | |
* https://stackoverflow.com/a/2450976/1293256 | |
* @param {Array} array The array to shuffle | |
* @return {String} The first item in the shuffled array | |
*/ | |
var shuffle = function (array) { | |
var currentIndex = array.length; | |
var temporaryValue, randomIndex; |
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
SET SQL_MODE='ALLOW_INVALID_DATES'; |
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
mysql -u your_user -p | |
mysql> show open tables where in_use>0; | |
mysql> show processlist; | |
mysql> kill put_process_id_here; |