Skip to content

Instantly share code, notes, and snippets.


Govert Verschuur verschuur

  • Winst uit je woning
  • Amsterdam
View GitHub Profile
View gist:c6b4fd385449b12f0f2418fabca16144
// Checkout file from stash
git checkout stash@{0} -- <filename>
// Save file from stash using a different name
git show stash@{0}:<full filename> > <newfile>
View Laravel LengthAwarePaginator based on JSON API links
verschuur / app.php
Created Nov 3, 2020 — forked from mmikkel/app.php
Craft 3 multi-env email settings
View app.php
* Yii Application Config
* Edit this file at your own risk!
* The array returned by this file will get merged with
* vendor/craftcms/cms/src/config/app/main.php and [web|console].php, when
* Craft's bootstrap script is defining the configuration for the entire
* application.
View SQL snippets
# Copy field data from one table to another
UPDATE target_table
INNER JOIN source_table USING (matching_key_field)
SET target_table.<field> = source_table.<field>
View PHPCS commands and info
# Commands
phpcs --config-set default_standard PSR12
phpcs --config-set show_progress 1
phpcs --config-set colors 1
phpcs --report=gitblame /path/to/code
phpcs -s --report=gitblame /path/to/code
# Handy rulesets
<?xml version="1.0"?>
<ruleset name="Testing Suites rulesets">
View php-cli-progress-bar.php
# Shamelessly stolen from
# Remember to start $done with 1 or more, or you'll get a division by zero. 🙀
function show_status($done, $total, $size = 30)
static $start_time;
// if we go over our bound, just ignore it
if ($done > $total) {
verschuur /
Created Sep 9, 2019 — forked from xedef/
Remove all .DS_Store files (or any unwanted indexing file) from a S3 bucket, recursively

You can replace "*.DS_Store" with any other recurrent file (e.g. Desktop.ini)


Validate that you are going to delete only what you want passing the --dryrun option. I've left if by default just in case of copy/paste.

aws s3 rm s3:// --dryrun --recursive --exclude "*" --include "*.DS_Store"

View Heroku env export & import
# Instructions:
# Make sure you have the Heroku CLI installed and configured (
# Replace source-heroku-app and target-heroku-app with your app name
# 1. Export existing app’s variables to config.txt.
heroku config -s -a source-heroku-app > config.txt
# 2. Review and push to another app
cat config.txt | tr '\n' ' ' | xargs heroku config:set -a target-heroku-app
verschuur / PreventSEOIndexingHeaders.php
Created Nov 16, 2017
Laravel middleware code to add response headers to prevent SEO indexing.
View PreventSEOIndexingHeaders.php
namespace App\Http\Middleware;
use Closure;
class PreventSEOIndexingHeaders
* Handle an incoming request.
verschuur / ViewComposerServiceProvider.php
Last active Nov 16, 2017
Laravel ViewComposerServiceProvider example with several registering options
View ViewComposerServiceProvider.php
namespace App\Providers;
use Illuminate\Support\Facades\View;
use Illuminate\Support\ServiceProvider;
class ViewComposerServiceProvider extends ServiceProvider