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 / gittag.php
Last active April 11, 2017 14:23
Retrieve the latest tag, based on the sorted version - https://packagist.org/packages/controlaltdelete/git-version
/**
* Retrieve the git version number so we can show it.
*/
$files = [];
$dir = dirname(dirname(dirname(__FILE__))) . '/.git/refs/tags';
if(file_exists($dir)) {
foreach (new DirectoryIterator($dir) as $file) {
if ($file->isDot()) {
continue;
}
  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	
@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|^$')
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class MagentoServiceProvider extends ServiceProvider
{
/**
* Bootstrap services.
*
@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
@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 / 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 / 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 / create-patch-helper-files.yml
Created October 24, 2024 20:05
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 / 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",