Skip to content

Instantly share code, notes, and snippets.

View michielgerritsen's full-sized avatar
👑
Test all the thing ✅

Michiel Gerritsen michielgerritsen

👑
Test all the thing ✅
View GitHub Profile
@michielgerritsen
michielgerritsen / instructions.md
Last active April 17, 2025 05:44
Find old Luma code so you can convert it to Hyvä Alpine.js code

Introduction

The goal of this script is to help you migrate you old Magento Luma code to Hyvä compliant code. Luma used to rely on Require.js to manage it's javascript components. Hyvä relies on Alpine.js for this. For a lot of modules there are already compatibility modules available. Custom code you have to convert yourself.

Usage

There are several ways to use this code:

  • Using Tampermonkey (Chrome) or Greasemonkey (Firefox). If you have that installed just click on "Raw" by the requirejs-finder.user.js file.
  • (Temporary) By injecting it into Magento's head. Open the admin and navigate to Content -> Design -> Click your theme -> HTML -> Head -> Add `` and place the code above between the two script tags.
@michielgerritsen
michielgerritsen / renovate.json
Created October 30, 2024 08:27
Renovate.json that I use on my Magento projects
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"config:recommended"
],
"ignorePaths": [
".ddev/"
],
"labels": ["dependencies"],
"timezone": "Europe/Amsterdam",
@michielgerritsen
michielgerritsen / create-patch-helper-files.yml
Last active April 14, 2025 17:10
An action for GitHub Actions to run the Ampersand Upgrade Patch Helper
name: "Create patch helper files"
on:
workflow_dispatch:
inputs:
defaultBranch:
description: 'Select the branch that is used as a base'
required: true
default: 'main'
phpVersion:
@michielgerritsen
michielgerritsen / README.md
Created May 1, 2024 08:55
Create patch helper files

What is this?

This file allows you to create a GitHub Actions workflow that can be triggered manually. When triggered, this workflow will run the Ampersand Patch Helper for you. The files generated are compatible with the Magento 2 Upgrade GUI.

It will save you the hassle of having 2 vendor folders (and PHPStorm indexing both 🫨), installing the Ampersand Patch Helper locally, and executing all related commands.

How to install?

  • Place the create-patch-helper-files.yml in your .github/workflows folder.
  • Commit the file to your repository.
@michielgerritsen
michielgerritsen / counries-list.json
Created January 3, 2024 14:26
Countries to lat & lon, keyed by ISO2
{
"AD": {
"name": "Andorra",
"latitude": 42.546245,
"longitude": 1.601554
},
"AE": {
"name": "United Arab Emirates",
"latitude": 23.424076,
"longitude": 53.847818
@michielgerritsen
michielgerritsen / deploy.php
Created January 27, 2020 18:57
Restart php-fpm on Laravel Forge using Deployer
<?php
desc('Restart php-fpm');
task('php-fpm:restart', function () {
run('sudo service php7.3-fpm reload');
});
after('deploy:symlink', 'php-fpm:restart');
@michielgerritsen
michielgerritsen / ComposerWordPressValetDriver.php
Last active July 7, 2019 11:28
A Laravel Valet driver for WordPress installations in the ./wordpress/ folder. Save in ~/.valet/Drivers/ComposerWordPressValetDriver.php
<?php
class ComposerWordPressValetDriver extends BasicValetDriver
{
/**
* Determine if the driver serves the request.
*
* @param string $sitePath
* @param string $siteName
* @param string $uri
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class MagentoServiceProvider extends ServiceProvider
{
/**
* Bootstrap services.
*
@michielgerritsen
michielgerritsen / disable-modules.sh
Last active October 30, 2017 13:29
Disable all non Magento modules in Magento 2
php bin/magento module:disable $(php bin/magento module:status |grep -vE 'Magento|List|None|^$')
  1. Go to Deployment Hooks -> Clone new release -> After this action -> Add Hook and add this line:
ln -s {{project}}/storage/wp-config.php {{release}}/wp-config.php
  1. Add this configuration under Linked Folders:
wp-content/uploads -> storage/wp-content/uploads