Skip to content

Instantly share code, notes, and snippets.

View matheusgontijo's full-sized avatar

Matheus Gontijo matheusgontijo

View GitHub Profile
@peterjaap
peterjaap / 2.4.7-p4-most-relevant-changes-according-to-claude.txt
Last active February 13, 2025 11:40
Magento 2.4.7-p4 patch update most relevant changes according to Claude
SECURITY & VALIDATION CHANGES:
1. app/code/Magento/Customer/Controller/Account/EditPost.php
- Removed file attribute deletion functionality for security
2. app/code/Magento/Config/Plugin/Model/Config/Backend/LocalePlugin.php
- Added new plugin to validate currency code values
3. app/code/Magento/Directory/Model/Config/Backend/WeightUnit.php
- Added new backend model to validate weight unit values
@Wirone
Wirone / imagick-3.7.0-failed-install-on-docker-PHP-8.3-build.txt
Last active January 16, 2025 21:54
Imagick 3.7.0 failed installation on PHP 8.3.2
Built on Docker with php:8.3.2-fpm-bullseye as a base image
Prerequisites installed: libmagickwand-dev, libmagickwand-6.q16-6
FYI: Same dependencies work properly on PHP 8.2.10
-----
326.0 downloading imagick-3.7.0.tgz ...
326.0 Starting to download imagick-3.7.0.tgz (360,138 bytes)
326.0 .........................................................................done: 360,138 bytes
@robzwolf
robzwolf / Hollywood.md
Created April 18, 2021 17:37
Hollywood

How to Launch Hollywood on Windows, macOS or Linux

  1. Install Docker Desktop.
  2. Open a Terminal (Windows / Mac / Linux) and maximise it to the full size of your screen.
  3. $ docker run --rm -it bcbcarl/hollywood
  4. To exit: Try mashing Ctrl-D and Ctrl-C. If you get to a terminal you can type exit to close the container.

    If this fails, just quit your terminal. 😁

@ppcdias
ppcdias / magento2-disable-unused-modules.sh
Last active December 13, 2024 00:08
Magento 2.4 Disable Unused Modules to Increase Performance
# magento 2 disable unused modules
bin/magento module:disable Vertex_AddressValidation
bin/magento module:disable Vertex_AddressValidationApi
bin/magento module:disable Vertex_Tax
bin/magento module:disable Temando_ShippingRemover
bin/magento module:disable Dotdigitalgroup_Chat
bin/magento module:disable Dotdigitalgroup_Email
@peterjaap
peterjaap / lighthouse-locally.md
Last active December 15, 2020 09:26
Run Lighthouse locally

Run Lighthouse locally

You only need Docker installed. Add to ~/.zshrc, or ~/.bashrc, or whatever you're using;

lh() {
  mkdir -p lighthouse && \
  docker run --rm -it -v "$PWD":/usr/src -w /usr/src markhobson/node-chrome /bin/bash -c "npm i -g lighthouse && lighthouse --enable-error-reporting --chrome-flags=\"--headless --no-sandbox\" $1 --output html --output-path ./lighthouse/index.html" && \
  open lighthouse/index.html
}
@amenk
amenk / query.sql
Created September 4, 2019 13:45
Find Magento 2 database sessions of a specific user ID
# user ID = 99 (if the ID is longer, adapat the s:2 part to the length
select FROM_UNIXTIME(session_expires), FROM_BASE64(session_data) as sd
from session
having sd like "%customer_id"";s:2:""99""%"
order by session_expires desc;
@vasilii-b
vasilii-b / m2-php-emulate-area-code.php
Last active September 16, 2024 13:16
Shows example of usage of Magento 2 emulate area code
<?php
declare(strict_types=1);
namespace Vendor\Module\Service;
use Magento\Framework\App\Area as AppArea;
use Magento\Framework\App\State as AppState;
use Magento\Framework\DataObject;
use Magento\Framework\Exception\NoSuchEntityException;
@OZZlE
OZZlE / mysql-faster-imports.sh
Last active October 16, 2024 02:27
Linux Bash Script to toggle faster mysql db imports
#!/usr/bin/env bash
# USAGE: mysqlOptimizeForImports <- before importing
# mysqlDefaultSettings <- to go back to normal
# Based on https://dba.stackexchange.com/questions/83125/mysql-any-way-to-import-a-huge-32-gb-sql-dump-faster/83385#83385
mysqlStateFile="$HOME/mysql.optimized.for.exports"
mysqlConfigLocation="/etc/mysql/my.cnf" # <-- change to the correct for your system, should be for global mysql settings
@luizventurote
luizventurote / valet-sample-magento.sh
Last active December 4, 2019 08:38
Bash script to install a Magento store with sample data automatically using Valet Plus and n98-magerun.
#!/usr/bin/env bash
folderName=${PWD##*/}
magentoUser="MAGENTO_PUBLIC_KEY"
magentoPassword="MAGENTO_SECRET_KEY"
n98-magerun2.phar install --dbHost="localhost" --dbUser="root" --dbPass="root" --dbName="${folderName}" --installationFolder="magento-folder" --installSampleData=yes --baseUrl="http://${folderName}.test/"
mv magento-folder/* .
@tiagohm
tiagohm / install-jekyll-fedora.sh
Last active October 23, 2018 11:10
Instalar Jekyll no Fedora 27 / Install Jekyll on Fedora 27
sudo dnf install ruby ruby-devel redhat-rpm-config gcc gcc-c++
sudo gem install json
sudo gem install jekyll bundler
sudo gem update --system
//Na pasta onde se encontra seus arquivos jekyll
bundle install
bundle update