Skip to content

Instantly share code, notes, and snippets.

@davirs
davirs / composer-patches.md
Created November 22, 2023 02:12 — forked from texboy/composer-patches.md
How to apply git patches using composer on a magento 2 project.

Introduction

Patches are great for small bugfixes since they're easy to create and maintain. You should follow magento's official documentation to install the required composer plugin. Don't forget to add the required patch section on your composer.json or composer will not be able to see your patches.

Getting started

Create a repo to start the creation of a patch.

  1. Go inside the folder that the file you need to fix is.
  2. Execute the git init . command.
  3. Execute the git add -A . command.
  4. Commit something. Ex: git commit -m "start of patch"
@davirs
davirs / _Magento2_DeleteTestData.md
Last active August 30, 2022 13:10 — forked from leek/_Magento2_DeleteTestData.md
Magento 2 - Delete All Test Data

These set of scripts are for Magento 2. For Magento 1, see this Gist.

@davirs
davirs / .gitlab-ci.yml
Created August 8, 2022 11:49 — forked from ankitdbst/.gitlab-ci.yml
Gitlab CI to deploy magento2 on AWS
image: ruby:2.5
stages:
- deploy
default:
before_script:
# For setting the IP of the runner with Amazon EC2 SG
- apt update
- apt install -y awscli jq
@davirs
davirs / tutorial.txt
Created August 7, 2022 02:01 — forked from luizomf/tutorial.txt
WSL2 e Docker no Windows 10.
### Tutorial oficial:
https://docs.microsoft.com/en-us/windows/wsl/install-win10
### Passo 1 (PowerShell Admin):
dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
### Passo 2 (PowerShell Admin):
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
### Passo 3
@davirs
davirs / gist:06a1265544ad712b5e5a733558879078
Created March 18, 2021 00:22 — forked from alihalabyah/gist:e9d5cd077efb4b62cdd40bf4cf75c8ac
Magento 2 Reset Directories and Files Permissions
find . -type f -exec chmod 644 {} \; // 644 permission for files
find . -type d -exec chmod 755 {} \; // 755 permission for directory
find ./var -type d -exec chmod 777 {} \; // 777 permission for var folder
find ./pub/media -type d -exec chmod 777 {} \;
find ./pub/static -type d -exec chmod 777 {} \;
chmod 777 ./app/etc
chmod 644 ./app/etc/*.xml
chmod -R g+w *
@davirs
davirs / README.md
Created September 30, 2020 22:13 — forked from vinicius-stutz/README.md
Máscara p/ telefones com 8 ou 9 dígitos (jquery.mask.js)
@davirs
davirs / magento-code-snippets.md
Created July 9, 2020 19:53 — forked from matinfo/magento-code-snippets.md
[magento] - code snippets

Magento Code Snippets

Download extension manually using mage

./mage config-set preferred_state stable
./mage clear-cache
./mage sync
./mage download community Module_Name
@davirs
davirs / My Magento Code.php
Created July 9, 2020 19:53 — forked from sunel/My Magento Code.php
Magento Snippets
<block type="cms/block" name="block_name">
<action method="setBlockId"><id>block_code</id></action>
</block>
{{block type="cms/block" block_id="block_code"}}
{{block type="catalog/product_list" category_id="79" template="catalog/product/list_random.phtml"}}
@davirs
davirs / Response.php
Created January 21, 2020 19:36 — forked from jonatasmaxi/Response.php
Arquivo Response.php feito para corrigir o incidente do zend
<?php
/**
* Zend Framework
*
* LICENSE
*
* This source file is subject to the new BSD license that is bundled
* with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
@davirs
davirs / delete_customers_and_orders_from_magento.sql
Created November 28, 2019 16:24 — forked from joostvanveen/delete_customers_and_orders_from_magento.sql
Delete all customers and orders from Magento 1*
--
-- This query delelets all customers and orders from your
-- Magento 1.* install. Handy, if you have a bloated
-- Magento database and you need to do a bit
-- of cleaning up for use on a local machine.
--
-- Replace PREFIX_ with your current Magento table prefix.
--
-- USE AT OWN RISK. ALWAY BACKUP YOUR DATABASE FIRST.
--