Skip to content

Instantly share code, notes, and snippets.

Test all the thing

Michiel Gerritsen michielgerritsen

Test all the thing
View GitHub Profile
michielgerritsen / deploy.php
Created Jan 27, 2020
Restart php-fpm on Laravel Forge using Deployer
View deploy.php
desc('Restart php-fpm');
task('php-fpm:restart', function () {
run('sudo service php7.3-fpm reload');
after('deploy:symlink', 'php-fpm:restart');
michielgerritsen / ComposerWordPressValetDriver.php
Last active Jul 7, 2019
A Laravel Valet driver for WordPress installations in the ./wordpress/ folder. Save in ~/.valet/Drivers/ComposerWordPressValetDriver.php
View ComposerWordPressValetDriver.php
class ComposerWordPressValetDriver extends BasicValetDriver
* Determine if the driver serves the request.
* @param string $sitePath
* @param string $siteName
* @param string $uri
View MagentoServiceProvider.php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
class MagentoServiceProvider extends ServiceProvider
* Bootstrap services.
michielgerritsen /
Last active Oct 30, 2017
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	
michielgerritsen /
Created Jun 16, 2017
Enable Xdebug on OSX for CLI scripts

This is tested with MAMP PRO, but should work with other installs types of PHP. Add this to your ~/.bashrc file. When you have an CLI script you would like to debug with Xdebug, simply call enablexdebug from your terminal, and enable Xdebug within PhpStorm.

composer update vendor/packagename
michielgerritsen / gittag.php
Last active Apr 11, 2017
Retrieve the latest tag, based on the sorted version -
View gittag.php
* 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()) {
michielgerritsen / bitbucket-pipelines.yml
Created Mar 18, 2017
Testing Laravel on Bitbucket Pipelines.
View bitbucket-pipelines.yml
image: phpunit/phpunit:5.0.3
- step:
- composer install
- cp .env.example .env
- php artisan key:generate
- chmod 777 storage bootstrap/cache -Rv
michielgerritsen / SecureWww.php
Created Feb 12, 2017
Middleware for Laravel to check if SSL is enabled and the domain is on www and redirects if necessary. If the domain starts with dev it continues.
View SecureWww.php
namespace App\Http\Middleware;
use Closure;
class SecureWww
* Handle an incoming request.