Skip to content

Instantly share code, notes, and snippets.

View PiotrSiejczuk's full-sized avatar

Piotr Siejczuk PiotrSiejczuk

View GitHub Profile
@henkvalk
henkvalk / varnish.vcl
Last active January 14, 2025 11:16
A solution for softpurges in Magento on Varnish 6.0 many thanks to @IvanChepurnyi
vcl 4.1;
import std;
import xkey;
# The minimal Varnish version is 6.0
# For SSL offloading, pass the following header in your proxy server or load balancer: 'X-Forwarded-Proto: https'
backend default {
@peterjaap
peterjaap / varnish6.vcl
Last active February 18, 2026 05:28
Updated Magento 2 Varnish 6 VCL, in cooperation with Varnish Software, see Xkey soft purge version here; https://gist.github.com/peterjaap/7f7bf11aa7d089792e8fcc2fb34760fa
# A number of these changes come form the following PR's; , combines changes in https://github.com/magento/magento2/pull/29360, https://github.com/magento/magento2/pull/28944 and https://github.com/magento/magento2/pull/28894, https://github.com/magento/magento2/pull/35228, https://github.com/magento/magento2/pull/36524, https://github.com/magento/magento2/pull/34323
# VCL version 5.0 is not supported so it should be 4.0 even though actually used Varnish version is 6
# See the Xkey version here: https://gist.github.com/peterjaap/7f7bf11aa7d089792e8fcc2fb34760fa
vcl 4.1;
import std;
# The minimal Varnish version is 6.0
# For SSL offloading, pass the following header in your proxy server or load balancer: '/* {{ ssl_offloaded_header }} */: https'
@Igloczek
Igloczek / derecrutify-your-linkedin.js
Last active July 5, 2022 18:18
Scripts that removes recruiters from your LinkedIn contacts
// How to use this script?
// 1. Set LinkedIn language to engligh (I just didn't test it on others)
// 2. Go to https://www.linkedin.com/mynetwork/invite-connect/connections/
// 3. Paste this script to the console and watch :)
[...document.querySelectorAll('.mn-connection-card')]
// Comment out line below, if you want to remove not only people joined your network in the last year
.filter(el => el.querySelector('.time-badge').innerText.search(/year/igm) === -1)
.filter(el => el.querySelector('.mn-connection-card__occupation').innerText.search(/recruit|rekru|hr|talent|headhunter|people|resource|hiring|build|job|researcher/gmi) !== -1)
.forEach((el, index) => {
@hostep
hostep / composer-v2-support-older-magento2-versions.md
Last active July 2, 2025 00:06
Add composer v2 support to older Magento2 versions

Add composer v2 support to older Magento2 versions

Magento 2.3.7 and 2.4.2 ship with composer v2 support out of the box but as far as I can see the only thing that needs to happen is to use some more modern versions of certain composer plugins which are used by certain dependencies of Magento.

This means we should be able to add composer v2 support to older Magento2 versions as well if we get a bit creative.

See below for diffs of the composer.json files you can apply to your projects, be sure to keep a mental note of these things, they will need to maintained by yourself in case newer versions of these modules are released. And if one day you update to Magento 2.3.7 or 2.4.2 or higher, you can remove these changes again.

⚠️ Disclaimer: use these tricks at your own risk!

@jalogut
jalogut / magento2-config-dump-skip-system.xml
Last active September 27, 2018 15:37
Magento 2 skip dumping the whole core_config_data when using app:config:dump
<!-- module.xml -->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
<module name="VendorName_ModuleName" setup_version="0.0.1" >
<sequence>
<module name="Magento_Config"/>
</sequence>
</module>
</config>
<!-- di.xml -->
@plentz
plentz / nginx.conf
Last active May 5, 2026 07:20
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048