Skip to content

Instantly share code, notes, and snippets.

View rafaelstz's full-sized avatar
👨‍🔬

Rafael Corrêa Gomes rafaelstz

👨‍🔬
View GitHub Profile
@rafaelstz
rafaelstz / shopify.php
Created September 8, 2023 16:14
Standalone Shopify APP PHP
<?php
use Shopify\Auth\FileSessionStorage;
use Shopify\Auth\Session;
use Shopify\Context;
use Shopify\ApiVersion;
Context::initialize(
apiKey: 'NA',
apiSecretKey: 'NA',
scopes: ['read_products'],
@rafaelstz
rafaelstz / magedeploy.sh
Created May 12, 2020 21:35
Magento 2 Deploy script
#!/usr/bin/env bash
LANGUAGES="en_US pt_BR"
# production or developer
ENVIRONMENT="production"
COMPOSER=$(which composer)
PHP=$(which php)
ROOT=$(pwd)
<?php
return [
'backend' => [
'frontName' => 'admin'
],
'install' => [
'date' => 'Mon, 14 Oct 2019 13:55:23 +0000'
],
'crypt' => [
'key' => 'xKNznqXjauz63rJpxd7vaPiTN9wEhnRM'
@rafaelstz
rafaelstz / valet-plus-destroy
Created June 4, 2019 07:01 — forked from dannygsmith/valet-plus-destroy
Remove valet-plus - reboot required
#!/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 September 21, 2024 12:14
Remove all Magento 2 test Sample 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`;
jQuery(function($){
//////////////////////////////////////////////////////
function limpa_formulário_cep() {
// Limpa valores do formulário de cep.
$("#billing\\:street1").val("");
$("#billing\\:city").val("");
$("#billing\\:region_id").val("");
}
### 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)
#!/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 May 22, 2023 20:03
Configure GrumPHP in your Magento 2 to check: Composer, PHPCS, PHPMD, PHPCSFixer, PHPCPD, PHPLint, Security Checker, XML Lint.

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