Skip to content

Instantly share code, notes, and snippets.

Avatar

Kirill Morozov kirmorozov

View GitHub Profile
@kirmorozov
kirmorozov / apply_jquery3.sh
Created May 30, 2019
jQuery 3 Patch for Magento 2.3.1
View apply_jquery3.sh
mkdir -p dev/patches
# apply jQuery 3 to the project
curl https://github.com/magento/magento2/compare/2.3.1...morozov-group:2.3.1-jquery3.patch |\
sed 's#/app/code/Magento/Catalog/#/vendor/magento/module-catalog/#g' |\
sed 's#/app/code/Magento/ConfigurableProduct/#/vendor/magento/module-configurable-product/#g' |\
sed 's#/app/code/Magento/ProductVideo/#/vendor/magento/module-product-video/#g' |\
sed 's#/app/code/Magento/Theme/#/vendor/magento/module-theme/#g' |\
sed 's#/app/code/Magento/Ui/#/vendor/magento/module-ui/#g' |\
sed 's#/app/code/Magento/User/#/vendor/magento/module-user/#g' > dev/patches/mg_jquery3.patch
View run_redis.sh
docker run -d --name redis \
-p 6379:6379 \
--restart always redis
@kirmorozov
kirmorozov / Magento_2.2.2_PHP7.4_Preload_vs_PHP-7.3-results.md
Last active Aug 23, 2021
Magento PHP7.4 Preload vs PHP 7.3 results.md
View Magento_2.2.2_PHP7.4_Preload_vs_PHP-7.3-results.md

Current Magento 2.2.2 PHP 7.4 with preload is 10%+ faster

Comparison of means

PHP 7.4 with preload is 11.07% faster then PHP 7.3

PHP 7.4 with preload is 13.25% faster then PHP 7.1

Sample 1 PHP 7.4 with Preload

Mean: 0.458

@kirmorozov
kirmorozov / collect.js
Last active Dec 4, 2018
Collect Magento 2 JS dependencies as directed graph
View collect.js
// Compatible with requirejs/alameda
let dependencies = Object.values(require.contexts._.deferreds).map((m) => {
if (m.hasOwnProperty('deps')) {
return m.deps.map((d) => {
return [m.map.id, d.id];
});
} else {
return [];
}
@kirmorozov
kirmorozov / run_mysql_8.sh
Last active Sep 29, 2020
run locally mysql 8 with mysql_native_password authentication.
View run_mysql_8.sh
docker run -d --name mysql8 \
-p 3306:3306 -p 33060:33060 \
-e MYSQL_ROOT_PASSWORD=123123qa \
--restart always mysql \
/entrypoint.sh mysqld --default-authentication-plugin=mysql_native_password \
--connect-timeout=31536000 \
--wait-timeout=31536000 \
--lock-wait-timeout=31536000 \
--character-set-server=utf8 \
--collation-server=utf8_general_ci \
@kirmorozov
kirmorozov / govcloudair.patch
Created Aug 23, 2017
Patches for docker Machine to Support VCloud Direct 5.6
View govcloudair.patch
Index: api.go
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>US-ASCII
===================================================================
--- api.go (revision 0d7be903f950c035d6e95eabfd9b011a507f4488)
+++ api.go (revision 17fa3ab2a352908cb4104a11f7c5c0e5eb8e10bb)
@@ -23,6 +23,7 @@
type Client struct {
VAToken string // vCloud Air authorization token