Skip to content

Instantly share code, notes, and snippets.

View lnoering's full-sized avatar

Leonardo Noering lnoering

View GitHub Profile
@lnoering
lnoering / install-discord.bash
Created July 19, 2018 21:55
Install discord (for the .tar.gz)
#!/usr/bin/env bash
cd ~/
mkdir -p ~/.local/bin
wget "https://discordapp.com/api/download/canary?platform=linux&format=tar.gz" -O discord.tar.gz
tar -xvf discord.tar.gz -C ~/.local/bin
sudo ln -s ~/.local/bin/DiscordCanary/discord.png /usr/share/icons/discord.png
sudo ln -s ~/.local/bin/DiscordCanary/DiscordCanary /usr/bin
wget https://gist.githubusercontent.com/AdrianKoshka/a12ca0bfe2f334a9f208aff72f8738c3/raw/9d606ad7ce7cc1dd23f6a99993e2396540538a02/discord.desktop -O discord.desktop
mkdir -p ~/.local/share/applications/
mv ~/discord.desktop ~/.local/share/applications/
@lnoering
lnoering / vendor-modules-zip.md
Last active July 26, 2023 21:21
Zip All modules from vendor

Zip all modules to install by artifact

Steps

Go to the vendor_name folder.

  • Ex.: cd vendor/amasty

Create the file at that folder.

  • Ex.: zip-all.sh
@lnoering
lnoering / m2-why-patch.md
Last active March 24, 2023 23:25
[Magento 2] - Patch

Utilizando patch no Magento 2.

SOBRE

Vantagens

  • Não irá aplicar caso o módulo de origem for atualizado e tiver alguma diferença de quando foi criado.
  • Não é necessário fazer reescrita de classe, deixando o processo de build mais complexo.
  • Caso o o módulo de origem passe a ter a correção/funcionalidade que foi criado com o patch, basta apenas ignorar ele.
  • Aplicamos N patch`s e conseguimos setar a ordem deles.
@lnoering
lnoering / .alias-v1.md
Last active January 9, 2023 14:20
[Magento 2] - Aliases no linux para desenvolvimento

First version of my aliases.

Aliases que utilizo para otimizar o meu tempo.

Comandos

Abrir softwares e projeto X

had dev <nome_projeto>

had dev <nome_pasta>/<nome_projeto>

@lnoering
lnoering / magento-2-tips.md
Last active December 14, 2022 19:17
[ Magento 2 ] Tips

Find your not compatible custom modules in Magento.

  • Version - ( 2.4.4 ~ 2.4.5-p1) add code in vendor/magento/framework/Reflection/MethodsMap.php line 143
if($paramReflection->detectType() == NULL)
{
    var_dump($paramReflection->getDeclaringClass());
    die();
}
@lnoering
lnoering / cloud-new-environment.md
Created November 16, 2022 15:26
[Magento Cloud] - Creating new environment to test the upgrade

Creating new environment to test the upgrade

1 - Create new branch from master

git checkout -b cloud/upgrade-2.4.5

2 - Push that branch to cloud

git push -u cloud cloud/upgrade-2.4.5:upgrade-2.4.5
@lnoering
lnoering / productAttributes.md
Last active September 2, 2022 17:37
[Magento 2] - Get all attributes from product

Get all product attributes from entity

SELECT
	ea.attribute_code,
	ea.frontend_label,
	ea.entity_type_id 
FROM 
	eav_attribute AS ea
LEFT JOIN eav_entity_type as eat ON eat.entity_type_code = 'catalog_product'
@lnoering
lnoering / m2b-script.sh
Last active August 10, 2022 13:17
[Magento 2] - Backup of database or media folder in server
#!/bin/bash
#
# Magento 2 - Backup scripts (database | media)
#
# @author Leonardo <lnoering@gmail.com>
# @version 1.0.0
# UnComment it if bash is lower than 4.x version
shopt -s extglob
@lnoering
lnoering / productValues.md
Last active July 6, 2022 14:01
Magento 2 - Get All Attribute values from entity by id

Magento 2

Get all eav data from specific product

use magento;

SET @ENTITY_TABLE = 'catalog_product_entity';
SET @COLUMNID = 'sku';