Skip to content

Instantly share code, notes, and snippets.

@kirmorozov
kirmorozov / 00_upstreams.conf
Created June 9, 2024 22:21
Local magento configs
upstream fastcgi_backend_php80 {
# use tcp connection
server 127.0.0.1:9010;
# or socket
# server unix:/var/run/php/php7.0-fpm.sock;
}
@kirmorozov
kirmorozov / loc.run.github-actions-agent.plist
Last active January 6, 2023 15:52
macOS Github actions service
<plist version="1.0">
<dict>
<key>Label</key>
<string>loc.run.github-actions-agent</string>
<key>WorkingDirectory</key>
<string>{WORKING_DIRECTORY}</string>
<key>EnvironmentVariables</key>
<dict>
<key>PATH</key>
<string>/opt/local/Library/Frameworks/Python.framework/Versions/Current/bin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin</string>
@kirmorozov
kirmorozov / apply_jquery3.sh
Created May 30, 2019 11:01
jQuery 3 Patch for Magento 2.3.1
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
@kirmorozov
kirmorozov / run_redis.sh
Created March 22, 2019 16:02
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 August 23, 2021 13:25
Magento 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 December 4, 2018 22:19
Collect Magento 2 JS dependencies as directed graph
// 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 September 29, 2020 05:14
run locally mysql 8 with mysql_native_password authentication.
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 August 23, 2017 10:21
Patches for docker Machine to Support VCloud Direct 5.6
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