Skip to content

Instantly share code, notes, and snippets.

View markshust's full-sized avatar
🤓
Writing, building, teaching

Mark Shust markshust

🤓
Writing, building, teaching
View GitHub Profile
@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!

// Modified from @mutsuda's https://medium.com/@mutsuda/create-an-ios-widget-showing-google-spreadsheets-data-856767a9447e
// by @levelsio
// HOW TO
// 1) Make a Google Sheet, we'll pull the first cell e.g. A1
// 2) Publish your Google Sheet, File -> Publish To Web
// 3) Copy the SHEET_ID in the URL, put it in here below:
const endpoint = "https://spreadsheets.google.com/feeds/cells/SHEET_ID/1/public/full?alt=json"
// 4) Install Scriptable @ https://apps.apple.com/us/app/scriptable/id1405459188
// 5) Copy this entire script in to Scriptable (tip: you can send it to your iPhone via Whatsapp/Messenger/Telegram etc)
@magenx
magenx / carding.sh
Last active November 1, 2025 03:40
#!/bin/bash
MAGE_BASE_URL="$1"
MAGE_SKU="$2"
PAYMENT_KEY="$3"
PAYMENT_METHOD="$4"
STORE_VIEW="$5"
CREDIT_CARD="$6"
CREDIT_CARD_CVC="$7"
@andyrbell
andyrbell / scanner.sh
Last active December 6, 2025 20:48
Make a pdf look scanned using ImageMagick
# use ImageMagick convert
# the order is important. the density argument applies to input.pdf and resize and rotate to output.pdf
convert -density 90 input.pdf -rotate 0.5 -attenuate 0.2 +noise Multiplicative -colorspace Gray output.pdf
@markshust
markshust / gist:c16c56525f55b71527f36faa4bd166ab
Created August 29, 2017 19:04 — forked from rogerclotet/gist:3901b03107437b247b03
Execute PHPUnit disabling xdebug
# Before using these aliases and function you must make a backup of your xdebug.ini
# (in this case /etc/php/conf.d/xdebug.ini.back)
# You will also need to be able to edit xdebug.ini
alias xdebug-disable='echo "" > /etc/php/conf.d/xdebug.ini'
alias xdebug-restore='cat /etc/php/conf.d/xdebug.ini.back > /etc/php/conf.d/xdebug.ini'
phpu() {
xdebug-disable
phpunit "$@"
@markshust
markshust / kadira-apm-setup-README.md
Last active June 11, 2020 02:04
Kadira APM Setup

Kadira APM Setup

Short guide on how to get Kadira APM setup with Docker.

  1. Setup at least on instance with 1.7GB RAM.
  2. Open up firewall ports for inbound TCP port 443. Also open up 11011 & 4000 for debugging. Port 11011 is kadira-engine, port 4000 is the kadira-ui.
  3. Setup a Mongo database, and have the connection string ready (with username and password).
  4. Install Docker https://docs.docker.com/engine/installation/linux/docker-ce/debian/ , run sudo usermod -aG docker your-user, then install Docker Compose https://docs.docker.com/compose/install/ on the instance.
  5. Verify that you have docker and docker compose installed correctly and can use it.
  6. Setup A-records to point your kadira-ip to kadira-engine.domain.com and kadira-ui.domain.com.
@ProcessEight
ProcessEight / Testing in Magento 2.md
Last active February 26, 2026 12:34
M2: Notes on setting up PHPUnit and writing/troubleshooting tests in Magento 2
@markshust
markshust / ContainerMyComponent.js
Created October 13, 2016 20:04
check if react component is mounted using recompose
import { compose, lifecycle, mapProps, withState } from 'recompose';
import MyComponent from '../components/MyComponent';
let isMounted = false;
const enhance = compose(
lifecycle({
componentDidMount() {
isMounted = true;
},
@d1i1m1o1n
d1i1m1o1n / text
Created October 6, 2016 12:16
How to disable auto-save in phpstorm
How to disable auto-save:
Go to File > Settings (Ctrl+Alt+S).
Go to Appearance & Behavior > System Settings.
Make sure the two are unchecked:
Save files on frame deactivation
Save files automatically if application is idle for x sec.
Go to Editor > General > Editor Tabs
Put a checkmark on "Mark modified files with asterisk"
(Optional but recommended) Under "Tab Closing Policy", select "Close non-modified files first". You may also want to increase the number of allowed tabs.
Click Apply > OK.
@maxclaus
maxclaus / alias-docker-compose.sh
Last active August 27, 2023 15:11
Aliases for docker-compose
alias c='docker-compose'
alias cb='docker-compose build'
alias cup='docker-compose up'
alias cr='docker-compose run --service-ports --rm'
alias crl='docker-compose run --service-ports --rm local'
alias crd='docker-compose run --service-ports --rm develop'
alias crt='docker-compose run --rm test'
alias crp='docker-compose run --rm provision'
alias crci='docker-compose run --rm ci'
alias crwt='docker-compose run --rm watchtest'