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
<img | |
width="180" | |
height="52" | |
src="{{view url='images/email/youtube.jpg'}}" | |
alt="Elcometer Youtube" | |
/> |
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
objArray.find(function (obj) { return obj.id === 3; }); |
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
$writer = new \Zend\Log\Writer\Stream(BP . '/var/log/test.log'); | |
$logger = new \Zend\Log\Logger(); | |
$logger->addWriter($writer); | |
$logger->info(print_r($variable, 1)); | |
M2.4 | |
$writer = new \Zend_Log_Writer_Stream(BP . '/var/log/custom.log'); | |
$logger = new \Zend_Log(); | |
$logger->addWriter($writer); | |
$logger->info(print_r($variable, 1)); |
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
// slice method | |
var sandwiches = ['turkey', 'tuna', 'chicken salad', 'italian', 'blt', 'grilled cheese']; | |
// ['chicken salad', 'italian', 'blt', 'grilled cheese'] | |
var fewerSandwiches = sandwiches.slice(2); | |
// ['chicken salad', 'italian', 'blt'] | |
var fewerSandwiches2 = sandwiches.slice(2, 4); | |
// ['italian', 'blt', 'grilled cheese'] |
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
// ES6 method | |
// Get all buttons as a NodeList | |
var btns = document.querySelectorAll('button'); | |
// Convert buttons NodeList to an array | |
var btnsArr = Array.from(btns); |
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
{{block class="Magento\\Cms\\Block\\Block" block_id="block-home-banners"}} |
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 original = [1, 2, 7, 42, 99, 101]; | |
// Get items bigger than 10 | |
var biggerThanTen = original.filter(function (item) { | |
return item > 10; | |
}); | |
// Get items smaller than 10 | |
var smallerThanTen = original.filter(function (item) { | |
if (item < 10) { |
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
bin/magento i18n:collect-phrases app/code/Vendor/Module/ -o app/code/Vendor/Module/i18n/en_US_raw.csv |
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
<block class="Magento\Cms\Block\Block" name="Promo"> | |
<arguments> | |
<argument name="block_id" xsi:type="string">promo</argument> | |
</arguments> | |
</block> |
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 numbers = [1, 4, 9]; | |
var doubles = numbers.map(function(num) { | |
return num * 2; | |
}); | |
// Logs [2, 8, 18] | |
console.log(doubles); | |
var data = [ | |
{ |