Skip to content

Instantly share code, notes, and snippets.

View albertobraschi's full-sized avatar

Alberto Braschi albertobraschi

View GitHub Profile
@albertobraschi
albertobraschi / GrumPHP-Magento2.md
Created May 22, 2023 20:03 — forked from rafaelstz/GrumPHP-Magento2.md
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   
[2022-12-08 16:37:13] mercadopagoLogHandler.INFO: Model_PaymentMethod getFinalCart finalcart0 => [{"seller_id":"25","product_id":"35","price":85,"invoice_price":"100.0000","shipping_price":0,"tax_amount":"0.0000","discount_amount":0}] [] []
[2022-12-08 16:37:13] mercadopagoLogHandler.INFO: Model_PaymentMethod getFinalCart finalcart1 => {"25":{"shippingprice":0,"invoiceprice":"100.0000","price":85,"products":"35","taxamount":"0.0000","discount":0,"seller":"25"}} [] []
[2022-12-08 16:37:13] mercadopagoLogHandler.INFO: Model_PaymentMethod getFinalCart finalcart2 => {"25":{"shippingprice":0,"invoiceprice":"100.0000","price":85,"products":"35","taxamount":"0.0000","discount":0,"seller":"25"},"0":{"price":18.01,"shippingprice":"18.0100","invoiceprice":18.01,"taxamount":0,"discount":0,"seller":0,"products":null}} [] []
[2022-12-08 16:37:13] mercadopagoLogHandler.INFO: Model_PaymentMethod getFinalCart finalcart3 => {"25":{"shippingprice":18.01,"invoiceprice":"100.0000","price":85,"products":"35","taxamount":"0.0000",
This file has been truncated, but you can view the full file.
{
"items":[
{
"id":33188,
"sku":"CH563HB",
"stock":[
{
"warehouse":"007",
"qty":108,
"price":128.605
@albertobraschi
albertobraschi / rfb-wine.md
Created September 10, 2021 16:47 — forked from tavinus/rfb-wine.md
Programas RFB (Receita Federal do Brasil) no Wine

Programas RFB no Wine

Este guia tem como objetivo guardar informações de como rodar os programas da receita federal no Wine.
Visa oferecer uma forma de rodar os programas proprietários do Windows no Linux.

Não use este guia para os programas da RFB baseado em Java!
Os programas da RFB baseados em Java devem rodar na VM Java do Linux nativamente.
Rodar Java no Wine não é recomendado!

Testado com Wine 3.0 no Linux Mint 18.3 64bit

Abreviações

2021-08-19T19:35:57+00:00 DEBUG (7): 1877 teve o estoque atualizado! - qtd: 9
2021-08-19T19:35:57+00:00 DEBUG (7): 1892 teve o estoque atualizado! - qtd: 6
2021-08-19T19:35:57+00:00 DEBUG (7): 1896 teve o estoque atualizado! - qtd: 80
2021-08-19T19:35:57+00:00 DEBUG (7): 2280 teve o estoque atualizado! - qtd: 13
2021-08-19T19:35:58+00:00 DEBUG (7): 2528 teve o estoque atualizado! - qtd: 21
2021-08-19T19:35:58+00:00 DEBUG (7): 2680 teve o estoque atualizado! - qtd: 13
2021-08-19T19:35:58+00:00 DEBUG (7): 2700 teve o estoque atualizado! - qtd: 106
2021-08-19T19:35:58+00:00 DEBUG (7): 2701 teve o estoque atualizado! - qtd: 99
2021-08-19T19:35:58+00:00 DEBUG (7): 2702 teve o estoque atualizado! - qtd: 105
2021-08-19T19:35:59+00:00 DEBUG (7): 2703 teve o estoque atualizado! - qtd: 63
This file has been truncated, but you can view the full file.
[2021-07-20 00:26:52] main.CRITICAL: Please upgrade your database: Run "bin/magento setup:upgrade" from the Magento root directory.
The following modules are outdated:
MercadoPago_Core schema: current version - 3.8.5, required version - 3.9.2
MercadoPago_Core data: current version - 3.8.5, required version - 3.9.2 {"report_id":"6e1c30ff362934ab19614fa96a5d2d34f2e8fc5c6edfd85ff25b6da43bb54c85","exception":"[object] (Magento\\Framework\\Exception\\LocalizedException(code: 0): Please upgrade your database: Run \"bin/magento setup:upgrade\" from the Magento root directory.
The following modules are outdated:
MercadoPago_Core schema: current version - 3.8.5, required version - 3.9.2
MercadoPago_Core data: current version - 3.8.5, required version - 3.9.2 at /var/www/html/vendor/magento/framework/Module/Plugin/DbStatusValidator.php:66)"} []
[2021-07-20 00:26:56] main.CRITICAL: Please upgrade your database: Run "bin/magento setup:upgrade" from the Magento root directory.
The following modules are outdated:
MercadoPa
[2021-07-19 15:07:26] main.CRITICAL: The contents from the "/var/www/html/pub/static/frontend/Smartwave/porto_child/pt_BR/mage/requirejs/mixins.min.js" file can't be read. Warning!file_get_contents(/var/www/html/pub/static/frontend/Smartwave/porto_child/pt_BR/mage/requirejs/mixins.min.js): failed to open stream: No such file or directory {"exception":"[object] (Magento\\Framework\\Exception\\FileSystemException(code: 0): The contents from the \"/var/www/html/pub/static/frontend/Smartwave/porto_child/pt_BR/mage/requirejs/mixins.min.js\" file can't be read. Warning!file_get_contents(/var/www/html/pub/static/frontend/Smartwave/porto_child/pt_BR/mage/requirejs/mixins.min.js): failed to open stream: No such file or directory at /var/www/html/vendor/magento/framework/Filesystem/Driver/File.php:185)"} []
[2021-07-19 15:07:42] main.CRITICAL: The contents from the "/var/www/html/pub/static/frontend/Smartwave/porto_child/pt_BR/mage/requirejs/mixins.min.js" file can't be read. Warning!file_get_contents(/var/www/html/pub
[2021-07-19 15:15:27] main.INFO: Item Magento_Backend::system_currency was removed [] []
[2021-07-19 15:15:27] main.INFO: Add of item with id Magento_Config::system_config was processed [] []
[2021-07-19 15:15:27] main.INFO: Add of item with id Magento_Theme::design_config was processed [] []
[2021-07-19 15:15:27] main.INFO: Add of item with id Magento_Theme::system_design_theme was processed [] []
[2021-07-19 15:15:27] main.INFO: Add of item with id Magento_Variable::system_variable was processed [] []
[2021-07-19 15:15:27] main.INFO: Add of item with id Magento_Backend::system_design_schedule was processed [] []
[2021-07-19 15:15:27] main.INFO: Add of item with id Magento_Backend::system_store was processed [] []
[2021-07-19 15:15:27] main.INFO: Add of item with id Magento_Backend::dashboard was processed [] []
[2021-07-19 15:15:27] main.INFO: Add of item with id Magento_Backend::system was processed [] []
[2021-07-19 15:15:27] main.INFO: Add of item with id Magento_Backend::system_tools was processed [] []
@albertobraschi
albertobraschi / gist:7bad8979e5166452887ddf02d5ff140f
Created April 19, 2021 17:48
Magento 2 - custom rule validation
define([
'jquery',
'jquery/ui',
'jquery/validate',
'mage/translate'
], function($){
'use strict';
return function() {
[16-Nov-2020 13:00:04 UTC] PHP Fatal error: Allowed memory size of 2097152 bytes exhausted (tried to allocate 4096 bytes) in /home/bernardaocom/public_html/app/code/core/Mage/CatalogSearch/Model/Indexer/Fulltext.php on line 463
[16-Nov-2020 13:33:32 UTC] PHP Parse error: syntax error, unexpected 'melhro' (T_STRING), expecting ',' or ')' in /home/bernardaocom/public_html/app/design/frontend/codazon_fastest/default/template/newsletter/subscribe.phtml on line 62
[16-Nov-2020 13:33:34 UTC] PHP Parse error: syntax error, unexpected 'melhro' (T_STRING), expecting ',' or ')' in /home/bernardaocom/public_html/app/design/frontend/codazon_fastest/default/template/newsletter/subscribe.phtml on line 62
[16-Nov-2020 13:33:38 UTC] PHP Parse error: syntax error, unexpected 'melhro' (T_STRING), expecting ',' or ')' in /home/bernardaocom/public_html/app/design/frontend/codazon_fastest/default/template/newsletter/subscribe.phtml on line 62
[16-Nov-2020 13:33:41 UTC] PHP Parse error: syntax error, unexpected 'melhro' (T_ST