# Install ESLint and Babel ESLint
# Make sure to install at least v5.1.0 of ESLint
npm install --save-dev eslint babel-eslint
# Install the Airbnb configs (3 of them, listed below)
npx install-peerdeps --dev eslint-config-airbnb
# Install Prettier + ESLint config
npm install --save-dev --save-exact prettier-eslint eslint-config-prettier
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
plugins: [ | |
`gatsby-plugin-react-helmet`, | |
{ | |
resolve: `gatsby-source-filesystem`, | |
options: { | |
name: `images`, | |
path: `${__dirname}/src/images`, | |
}, | |
}, | |
`gatsby-transformer-sharp`, |
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 | |
namespace Vendor\Namespace\Plugin; | |
use Magento\Catalog\Helper\ImageFactory; | |
use Magento\Catalog\Helper\Product\Compare; | |
use Magento\Catalog\Model\ProductRepository; | |
class AddImageToCompareProductsPlugin | |
{ |
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
--- | |
# Output debugging info | |
# loglevel: debug | |
# Major version of Bootstrap: 3 or 4 | |
bootstrapVersion: 4 | |
# If Bootstrap version 4 is used - turn on/off flexbox model | |
useFlexbox: true |
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\Area; | |
require __DIR__ . '/app/bootstrap.php'; | |
class testAbstractExtensibleModelApp extends \Magento\Framework\App\Http implements \Magento\Framework\AppInterface | |
{ | |
/** | |
* @return \Magento\Framework\App\Response\Http | |
*/ |
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
<div data-bind="scope: 'messages'"> | |
<div data-bind="visible: isVisible(), click: removeAll"> | |
<!-- ko if: cookieMessages && cookieMessages.length > 0 --> | |
<div role="alert" data-bind="foreach: { data: cookieMessages, as: 'message' }" class="messages"> | |
<div data-bind="attr: { | |
class: 'message-' + message.type + ' ' + message.type + ' message', | |
'data-ui-id': 'message-' + message.type | |
}"> | |
<div data-bind="html: message.text"></div> | |
</div> |
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
define([ | |
'jquery', | |
'uiComponent', | |
'Magento_Customer/js/customer-data', | |
'underscore', | |
'jquery/jquery-storageapi' | |
], function ($, Component, customerData, _) { | |
'use strict'; | |
return Component.extend({ |
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 | |
namespace Revival\Seo\Block; | |
use Magento\Framework\View\Element\Template; | |
/** | |
* To make this appear in the header for the catalog, you'd need to add this as a block in ${THEME_DIR}/Magento_Catalog/layout/catalog_category_view.xml | |
* | |
* EG: |
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
Stop using the arrow keys and navigate the command line more quickly with | |
ctrl+A: moves to the start of the line | |
ctrl+E: moves to the end of the line | |
ctrl+B: move back one character | |
ctrl+F: move forward one character |
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
function get_browser() { | |
var ua=navigator.userAgent,tem,M=ua.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i) || []; | |
if(/trident/i.test(M[1])){ | |
tem=/\brv[ :]+(\d+)/g.exec(ua) || []; | |
return {name:'IE',version:(tem[1]||'')}; | |
} | |
if(M[1]==='Chrome'){ | |
tem=ua.match(/\bOPR|Edge\/(\d+)/) | |
if(tem!=null) {return {name:'Opera', version:tem[1]};} | |
} |