Skip to content

Instantly share code, notes, and snippets.

View vasilii-b's full-sized avatar
🙂

Vasilii Burlacu vasilii-b

🙂
View GitHub Profile
@roma-glushko
roma-glushko / Vendor\Module\Plugin\Checkout\AddProductLabelPlugin
Created April 8, 2019 08:16
Usage of Magento\Framework\Stdlib\ArrayManager in Magento 2 while working with nested arrays
<?php
declare(strict_types=1);
namespace Vendor\Module\Plugin\Checkout;
use Magento\Checkout\Model\DefaultConfigProvider;
use Magento\Framework\Stdlib\ArrayManager;
class AddProductLabelPlugin
@vasilii-b
vasilii-b / m2-php-emulate-area-code.php
Last active September 16, 2024 13:16
Shows example of usage of Magento 2 emulate area code
<?php
declare(strict_types=1);
namespace Vendor\Module\Service;
use Magento\Framework\App\Area as AppArea;
use Magento\Framework\App\State as AppState;
use Magento\Framework\DataObject;
use Magento\Framework\Exception\NoSuchEntityException;
@ProcessEight
ProcessEight / Anatomy of Magento 2: Layered Navigation.md
Last active February 17, 2024 05:39
In-depth exploration of how layered navigation is implemented in Magento 2

Anatomy of Magento 2: Layered Navigation

Points for investigation

  • Generate high-level overview of all the main components
  • How are the total item counts for each option generated?
  • How is the catalog updated to display the matching products?
  • How are options rendered?
  • What are the customisation points?
  • What events are dispatched?
@roma-glushko
roma-glushko / README.md
Created June 19, 2018 09:21 — forked from amenk/README.md
How To Apply a Magento 2 Patch to your project
  • Find the commit a GitHub
  • Add .patch to the URL
  • Require vaimo/composer-patches
  • Add an entry like the above, with path-removal-level 5, to the composer.json
@Shourai
Shourai / namecheap SSL.md
Created October 21, 2017 12:49
Letsencrypt SSL certificate with namecheap hosting

source: https://savedlog.com/uncategorized/letsencrypt-ssl-certificate-namecheap-hosting/

The “Positive SSL” certificate I bought along with my domain is invalid with any of my subdomains and cannot be used with wildcards. One annoying thing is that namecheap doesn’t offer auto installation of free let’s encrypt certificates, even though, they are saying “Namecheap is dedicated to data security and privacy for all internet users. We believe the movement to encrypt nearly all web traffic is a positive direction. As more sites embrace HTTPS and use of security products, providers of free SSL are beginning to come online.”

Let me show you what it needs to be done in order to “encrypt nearly all web traffic”.

First, not required but it’s helpful to enable ssh access, it is not enabled by default on the base hosting plans, just go an start a live chat and request ssh access.

@thenets
thenets / Dockerfile_laravel
Created August 22, 2017 01:41
Dockerfile for Laravel - Ubuntu 16.04
FROM ubuntu:16.04
RUN apt-get update && \
apt-get dist-upgrade -y && \
apt-get install -y htop curl nano
# Install PHP
RUN apt-get install -y php7.0 php7.0-mbstring php7.0-dom
@rossmc
rossmc / .stylelintrc.json
Last active February 6, 2021 12:56
Stylelint configuration object for Magento 2 Projects based on their coding standards http://devdocs.magento.com/guides/v2.0/coding-standards/code-standard-less.html
{
"rules": {
"indentation": 4,
"block-opening-brace-space-before": "always",
"block-opening-brace-newline-after": "always",
"block-closing-brace-newline-before": "always",
"selector-list-comma-newline-after": "always",
"string-quotes": "single",
"selector-combinator-space-after": "always",
"selector-combinator-space-before": "always",
@nepsilon
nepsilon / git-change-commit-messages.md
Last active September 7, 2024 11:11
How to change your commit messages in Git? — First published in fullweb.io issue #55

How to change your commit messages in Git?

At some point you’ll find yourself in a situation where you need edit a commit message. That commit might already be pushed or not, be the most recent or burried below 10 other commits, but fear not, git has your back 🙂.

Not pushed + most recent commit:

git commit --amend

This will open your $EDITOR and let you change the message. Continue with your usual git push origin master.

@jonsuh
jonsuh / .bash_profile
Last active February 16, 2024 17:17
Bash echo in color
# ----------------------------------
# Colors
# ----------------------------------
NOCOLOR='\033[0m'
RED='\033[0;31m'
GREEN='\033[0;32m'
ORANGE='\033[0;33m'
BLUE='\033[0;34m'
PURPLE='\033[0;35m'
CYAN='\033[0;36m'
select p1.sku `parent sku`, group_concat(p2.sku) `associated skus`, lt.code `type`
from catalog_product_link l
inner join catalog_product_entity p1 on p1.entity_id = l.product_id
inner join catalog_product_entity p2 on p2.entity_id = l.linked_product_id
inner join catalog_product_link_type lt on l.link_type_id = lt.link_type_id
group by l.product_id