Skip to content

Instantly share code, notes, and snippets.

Rafael Corrêa Gomes rafaelstz

View GitHub Profile
@rafaelstz
rafaelstz / magedeploy.sh
Created May 12, 2020
Magento 2 Deploy script
View magedeploy.sh
#!/usr/bin/env bash
LANGUAGES="en_US pt_BR"
# production or developer
ENVIRONMENT="production"
COMPOSER=$(which composer)
PHP=$(which php)
ROOT=$(pwd)
View env.php
<?php
return [
'backend' => [
'frontName' => 'admin'
],
'install' => [
'date' => 'Mon, 14 Oct 2019 13:55:23 +0000'
],
'crypt' => [
'key' => 'xKNznqXjauz63rJpxd7vaPiTN9wEhnRM'
@rafaelstz
rafaelstz / valet-plus-destroy
Created Jun 4, 2019 — forked from dannygsmith/valet-plus-destroy
Remove valet-plus - reboot required
View valet-plus-destroy
#!/usr/bin/env bash
#styles
VP_NONE='\033[00m'
VP_RED='\033[01;31m'
VP_GREEN='\033[01;32m'
VP_YELLOW='\033[01;33m'
VP_PURPLE='\033[01;35m'
VP_CYAN='\033[01;36m'
VP_WHITE='\033[01;37m'
@rafaelstz
rafaelstz / Magento 2 - Remove all customer data
Last active Sep 25, 2019
Remove all Magento 2 test Sample Data
View Magento 2 - Remove all customer data
SET FOREIGN_KEY_CHECKS=0;
TRUNCATE TABLE `customer_entity`;
TRUNCATE TABLE `customer_entity_datetime`;
TRUNCATE TABLE `customer_entity_decimal`;
TRUNCATE TABLE `customer_entity_int`;
TRUNCATE TABLE `customer_entity_text`;
TRUNCATE TABLE `customer_entity_varchar`;
TRUNCATE TABLE `customer_address_entity`;
TRUNCATE TABLE `customer_address_entity_datetime`;
View top-modules-magento2.md

Top modules for Magento 2

I update this page to have the top Magento 2 modules for performance, development, ux and more.

Performance

Check the store performance tips in an admin panel dashboard

https://github.com/magehost/performance-dashboard

View autocompletar-cep.js
jQuery(function($){
//////////////////////////////////////////////////////
function limpa_formulário_cep() {
// Limpa valores do formulário de cep.
$("#billing\\:street1").val("");
$("#billing\\:city").val("");
$("#billing\\:region_id").val("");
}
View Useful-git-commands
### Show the last commits since the last merge
git log $(git merge-base --octopus $(git log -1 --merges --pretty=format:%P)).. --boundary
### Show all the files changed since the last merge via git diff
git diff --cc $M $M^1 $M^2 $(git merge-base $M^1 $M^2)
View optimize.sh
#!/bin/bash
PROGNAME=${0##*/}
INPUT=''
QUIET='0'
NOSTATS='0'
max_input_size=0
max_output_size=0
usage()
@rafaelstz
rafaelstz / GrumPHP-Magento2.md
Last active Apr 30, 2020
Configure GrumPHP in your Magento 2 to check: Composer, PHPCS, PHPMD, PHPCSFixer, PHPCPD, PHPLint, Security Checker, XML Lint.
View GrumPHP-Magento2.md

Install GrumPHP in your Magento 2

Create the grumphp.yml in the root folder of your project and run these commands below:

    composer require "phpro/grumphp:^0.14" --dev
    composer require nlubisch/grumphp-easycodingstandard --dev
    composer require wearejust/grumphp-extra-tasks --dev
    composer require jakub-onderka/php-parallel-lint --dev   
@rafaelstz
rafaelstz / 1step-Install-Deployer-Magento2-BitbucketPipelines.md
Last active Jun 23, 2020
Automated deploy using Magento 2 + Bitbucket Pipelines + Deployer
View 1step-Install-Deployer-Magento2-BitbucketPipelines.md

Use both files in your root folder and run:

curl -LO https://deployer.org/deployer.phar && sudo mv deployer.phar /usr/local/bin/dep && sudo chmod +x /usr/local/bin/dep
composer require deployer/recipes --dev
composer require rafaelstz/deployer-magento2 dev-master --dev
You can’t perform that action at this time.