Skip to content

Instantly share code, notes, and snippets.

View phaelfp's full-sized avatar

Raphael Freitas Pereira phaelfp

View GitHub Profile
@phaelfp
phaelfp / README.md
Created November 11, 2020 13:20 — 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.

@phaelfp
phaelfp / ButtonLink.js
Created July 28, 2020 23:17 — forked from omariosouto/ButtonLink.js
Aula 01 - Códigos Extras
@phaelfp
phaelfp / docker-git-post-receive.sh
Created July 13, 2020 11:36 — forked from Aukhan/docker-git-post-receive.sh
A sample git post-receive hook to deploy with docker. Use the latest commit hash as image tags to make sure the latest gets pulled always, assumes services were deployed using docker stack deploy.
#!/bin/bash
PREFIX="MY CLIENT -"
REPO_PATH='/home/ubuntu/server/client'
ACCEPTABLE_BRANCH="DEV"
COMPOSE_FILE="docker-compose.production.yml"
CLIENT_IMAGE="127.0.0.1:5000/mpc_nginx_client"
@phaelfp
phaelfp / Readme.md
Created July 10, 2020 12:42
Dicas de Git - Akita O Rails

Dicas de Git

05 Julho 2009, 14:56 h

Se você ainda não aprendeu Git, um bom lugar para começar é meu Micro Tutorial de Git. Para complementar, existem algumas dicas úteis para usar no dia-a-dia que vou explicar agora. Mesmo assim, Git é um mundo rico e complexo, existem infinitas possibilidades e você nunca vai se cansar de aprender coisas novas com ele. Recomendo também acompanhar o site GitReady para continuar aprendendo truques novos.

Para começar, vamos criar um novo repositório para exemplo:

rails teste
@phaelfp
phaelfp / README.md
Created June 5, 2020 11:51
Configurar o volume correto do microfrone no linux

Mais um pequeno tutorial para os amantes de Linux com a qualidade MeuPinguim. Nossa especialidade é facilitar ao máximo o uso de comandos no Linux. Portanto, com apenas um comando você pode estar testando seu microfone. Mas aí também tem um pequeno detalhe: o uso de um fone de ouvido. Depois eu te explico. Vamos nessa!!

Testando seu microfone Pegue um fone de ouvido qualquer e plugue no seu computador ou laptop para testar o microfone. “Mas Tio Pinguim, por que tem que ter fone de ouvido?”. Caro noob boy, porque com o fone de ouvido você evita a microfonia.

@phaelfp
phaelfp / list.md
Created May 28, 2020 19:08 — forked from dzungtran/list.md
List of tables to safely truncate in Magento

Before you do anything

  • Make sure you test clearing this data in a non-production environment first.
  • Always make backups before you lose data forever.
  • Make sure you're truncateing, not droping.
  • Probably a good idea to reindex everything via shell after mass deleting records

To expand on Jim's answer, Magento Support doesn't need the contents of these tables when they ask for a copy of your DB, so you could consider them non-essential.

@phaelfp
phaelfp / 2019-https-localhost.md
Created March 24, 2020 16:29 — forked from cecilemuller/2019-https-localhost.md
How to create an HTTPS certificate for localhost domains

How to create an HTTPS certificate for localhost domains

This focuses on generating the certificates for loading local virtual hosts hosted on your computer, for development only.

Do not use self-signed certificates in production ! For online certificates, use Let's Encrypt instead (tutorial).

@phaelfp
phaelfp / README.TXT
Created June 28, 2019 13:41
Ajustes rápidos Magento 2
Alter Base Url in Terminal
php bin/magento setup:store-config:set --base-url="http://localhost:8080/"
Alter Base Security Url in Terminal
php bin/magento setup:store-config:set --base-url-secure="https://localhost:8080/"
After actions crear a cache
php bin/magento cache:flush
Display the Admin URI
@phaelfp
phaelfp / magento-2-debugging-tricks-setdata-dataobject-php-and-xdebug.php Magento 2 Debugging Tricks - setData, DataObject.php & xDebug by Matheus Gontijo
Magento 2 Debugging Tricks - setData, DataObject.php & xDebug by Matheus Gontijo
Video: https://www.youtube.com/watch?v=eo8N7e9eEPI
-----------------------------------------------
What is "stripos"?
<?php
// https://www.php.net/stripos
Magento 1
SET @passwd='newpassord', @salt='5k';
For admin
update admin_user SET password = CONCAT(MD5(CONCAT(@salt , @passwd)), CONCAT(":", @salt )) where email = '[email protected]';
For customer
update customer_entity_varchar set value = CONCAT(MD5(CONCAT(@salt , @passwd)), CONCAT(":", @salt ))
where entity_id IN (select entity_id from customer_entity where email = '[email protected]')
and attribute_id in ( select attribute_id from eav_attribute where entity_type_id = 1 and attribute_code = 'password_code' )
and entity_type_id = 1;