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