Skip to content

Instantly share code, notes, and snippets.

View matheusgontijo's full-sized avatar

Matheus Gontijo matheusgontijo

View GitHub Profile
@Wirone
Wirone / imagick-3.7.0-failed-install-on-docker-PHP-8.3-build.txt
Last active April 29, 2024 23:43
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
@ppcdias
ppcdias / magento2-disable-unused-modules.sh
Last active March 26, 2024 08:13
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 October 25, 2021 16:19
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 April 7, 2024 00:32
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
@DavMorr
DavMorr / gist:53e3ad5c26d16f4f6be3220b078b19c9
Last active March 9, 2024 11:43
Include hidden files in tar archive
When you create a tar archive of a directory tree the hidden files are normally not included. Here’s how to include the hidden files.
Say you have a web directory called “/var/www/html/mysite/” that contains the following tree:
.htaccess
index.php
logo.jpg
style.css
admin_dir/.htaccess
admin_dir/includes.php
@rogeriopradoj
rogeriopradoj / composer.json
Created July 2, 2017 17:07
mail.php - phpmailer + mailhog - send mail via smtp
{
"require": {
"phpmailer/phpmailer": "^5.2"
}
}