Skip to content

Instantly share code, notes, and snippets.

Code, Eat, Sleep++;

Jared molotovbliss

Code, Eat, Sleep++;
View GitHub Profile
jordanvector / magento-consumers-mysql-rabbit-env
Created Feb 4, 2021
Magento Env.php consumers mysql to rabbitmq
View magento-consumers-mysql-rabbit-env
'queue' => [
'amqp' => [
'host' => 'localhost',
'port' => '5672',
'user' => 'guest',
'password' => 'guest',
'virtualhost' => '/',
'ssl' => ''
'topics' => [
Last active Apr 13, 2020
Updated Magento 2 cleanup script for sensitive data in wishlist_item_option, quote_item_option AND order_item_option (not in original script). Also added try/catch block for unserializable data. See for more info and
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
use Magento\Framework\App\Bootstrap;
use Magento\Framework\DB\Adapter\AdapterInterface;
use Magento\Framework\DB\Query\Generator;
use Magento\Framework\DB\Select\QueryModifierFactory;
mnapoli /
Last active Oct 22, 2021
PrettyCI migration

This page will help you run continuous integration for PHP CodeSniffer and PHP-CS-Fixer using GitHub Actions.

To setup GitHub Actions in your repository, create a .github/workflows/ci.yml file in your repository and commit it.

The content of that file depends on the tool you want to run, please read the examples below.

Note: the examples below are provided to get you started easily, it is possible you may need to adjust them to fit your project.


mpchadwick / gist:d732c289120ef9955e77e5801dd2fc1d
Created Jan 28, 2020
View gist:d732c289120ef9955e77e5801dd2fc1d
# Categories
FROM eav_attribute ea
LEFT JOIN eav_entity_type eet
ON eet.entity_type_id = ea.entity_type_id
LEFT JOIN catalog_category_entity_text ccet
wigman / Compress Magento media
Last active Aug 6, 2021
Compress Magento media from commandline
View Compress Magento media
# you need these installed if you want to:
sudo apt-get update
# resize images
sudo apt-get install imagemagick -y
# compress jpg and png files
sudo apt-get install jpegoptim optipng
# compress video's
sudo apt-get install ffmpeg
rsisco / gist:6deeb3209ec9a396c859ca249a9ab5fa
Last active Jan 11, 2021
Magento 2 - Identify gallery image files missing from filesystem
View gist:6deeb3209ec9a396c859ca249a9ab5fa
mysql -u <user> -p <db> -h <host> -e "SELECT distinct case when value like '/%' then concat('.',value) else value end FROM catalog_product_entity_media_gallery" | awk '{print $1}' | xargs ls | grep "cannot access"
satishgumudavelli / magento2preview.php
Created Nov 12, 2019
Magento 2 order,invoice,shipment,credit meno preview emails
View magento2preview.php
use Magento\Framework\App\Bootstrap;
require __DIR__ . '/app/bootstrap.php';
$params = $_SERVER;
$bootstrap = Bootstrap::create(BP, $params);
$objectManager = $bootstrap->getObjectManager();
antoinekociuba / m2_clean_product_eav_values.sql
Created Nov 10, 2019
Magento 2 - Clean product EAV values (zombie product values, even if attribute(s) is/are not on concerned attribute set(s) anymore). Inspiration from
View m2_clean_product_eav_values.sql
CREATE TABLE catalog_product_entity_int_old LIKE catalog_product_entity_int;
INSERT INTO catalog_product_entity_int_old SELECT * FROM catalog_product_entity_int;
DELETE FROM catalog_product_entity_int
WHERE value_id IN
(SELECT cpei.value_id
FROM catalog_product_entity_int_old cpei
WHERE cpei.attribute_id NOT IN
(SELECT eea.attribute_id
FROM eav_entity_attribute eea
bjoern-flagbit / mysql-select-simples-not-assigned-to-parents.sql
Last active Feb 10, 2020
Magento2 - MySQL Select simples products not assigned to parents
View mysql-select-simples-not-assigned-to-parents.sql
SELECT * FROM `catalog_product_entity`
LEFT JOIN `catalog_product_entity_int` ON `catalog_product_entity`.`entity_id` = `catalog_product_entity_int`.`entity_id`
WHERE `catalog_product_entity`.`type_id` = 'simple' AND `catalog_product_entity_int`.`attribute_id` = (SELECT `attribute_id` FROM `eav_attribute` WHERE `attribute_code` = 'visibility') AND `catalog_product_entity_int`.`value` = 1 AND `catalog_product_entity`.`entity_id` NOT IN
SELECT `product_id` FROM `catalog_product_super_link`
pobegov / convert_latin1_data_in_a_utf8_mysql_database_to_utf8mb4.php
Created Jul 4, 2019
Convert MySQL Database (tables and data) to UTF8MB4, where UTF8 data stored via latin1 connection
View convert_latin1_data_in_a_utf8_mysql_database_to_utf8mb4.php
* Requires php >= 5.5
* Use this script to convert utf-8 data in utf-8 mysql tables stored via latin1 connection
* This is a PHP port from:
* Once the script ran over your databases, change your database connection charset to utf8: