Skip to content

Instantly share code, notes, and snippets.

View vasilii-b's full-sized avatar
🙂

Vasilii Burlacu vasilii-b

🙂
View GitHub Profile
@antonmakarenko
antonmakarenko / translation-magento2x.md
Last active March 21, 2021 21:26
Translation Mechanism in Magento 2.x Platform

Translation Mechanism in Magento 2.x Platform

This article discusses the translation mechanism in Magento 2.x, and contrasts it with that of Magento 1.x. The intended audience is Magento developers who would like to better learn the Magento architecture.

The Magento 2.x source code described here has been available since Magento 2.0.0.0-dev46 release and can be viewed on the GitHub at https://github.com/magento/magento2/commit/0849373d7636cfa17b70b8188bfc36d13ae749c1 or later commits.

Implementation Overview in Magento 1.x

Magento 1.x can present the user interface in different languages without modifying the actual application source code—it translates the system messages, error messages, and labels for display in the UI. Some messages may be displayed in logs for a system administrator or a developer—those don't need to be translated. By convention, in the source code, the labels and system messages for UI are expressed in English (en_US).

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
@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'
@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.

@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",
@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
@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.

@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
@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?
@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;