Skip to content

Instantly share code, notes, and snippets.

The next step…

Michelangelo van Dam DragonBe

The next step…
Block or report user

Report or block DragonBe

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
DragonBe / Vagrantfile-php7.3
Created Oct 8, 2019
Quickly set up a Vagrantbox with Debian 8 and PHP 7.3
View Vagrantfile-php7.3
Vagrant.configure("2") do |config| = "debian/jessie64"
config.vm.hostname = "jenkins-php7" "private_network", ip: ""
config.vm.synced_folder ".", "/vagrant", disabled: true
config.vm.provision "shell", inline: <<-SCRIPT
apt-get update
apt-get upgrade -y
apt-get install -y \
ca-certificates \
DragonBe / Vagrantfile
Last active Oct 7, 2019
Quickly run PHP 7.2, MySQL 5.7 and Nginx 1.14 within Vagrant
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
Vagrant.require_version ">= 2.2.0"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vagrant.plugins = ["vagrant-vbguest"]
DragonBe /
Created Jun 7, 2018
Creating a GPG signed archive of your GIT source code with SHA 256 checksums in bash
# Getting the current project's directory
pf=$(printf '%q\n' "${PWD##*/}")
# Getting the current configured user's email
gpguser=$(git config
if [ -z $gpguser ]
echo "!!! ERROR: No user for GIT configured !!!"
DragonBe / Vagrantfile-php7.2
Created Mar 20, 2018
A quick Vagrant file to get started with PHP 7.2
View Vagrantfile-php7.2
# -*- mode: ruby -*-
# vi: set ft=ruby :
@script = <<SCRIPT
# Fix for
if ! grep -q "ubuntu-xenial" /etc/hosts; then
echo " ubuntu-xenial" >> /etc/hosts
DragonBe / Vagrantfile
Created Jan 19, 2018
A quick-and-simple VM with PHP 7.2
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config| = "debian/jessie64"
config.vm.host_name = "phpvm"
config.vm.box_check_update = false "private_network", ip: ""
config.vm.provider "virtualbox" do |vb|
vb.memory = "1024"
DragonBe /
Created Dec 1, 2017
Basic Microsoft Azure CLI/SDK commands to quickly launch a web app on Azure cloud services
azure login
azure group create -t project=<project_name> <group_name> westeurope
azure appserviceplan create <group_name> <service_name> westeurope F1
azure webapp create <group_name> <app_name> westeurope <service_name>
azure webapp config set --phpversion 7.1 --detailederrorloggingenabled true <group_name> <app_name>
DragonBe / dnt-check.php
Created Oct 20, 2017
Functionality to verify if "Do not track" is set in the browser configuration.
View dnt-check.php
* Functionality to verify if "Do not track" is set
* in the browser configuration.
if (array_key_exists('HTTP_DNT', $_SERVER) && (1 === (int) $_SERVER['HTTP_DNT'])) {
echo 'Do not track me enabled';
} else {
echo 'Do not track me disabled';
DragonBe / plugins.txt
Created Sep 7, 2017
Jenkins plugins preloader for Jenkins Docker image
View plugins.txt
DragonBe / FinalClass.php
Created Jul 20, 2017
Testing final classes is tricky, but possible even though you cannot directly mock a "final" class
View FinalClass.php
namespace FinalClass;
require_once __DIR__ . '/vendor/autoload.php';
use PHPUnit\Framework\TestCase;
final class Foo
protected $bar;
DragonBe / SortableDirectoryIterator.php
Created Jun 22, 2017
Sortable DirectoryIterator based on last modification time
View SortableDirectoryIterator.php
class SortableDirectoryIterator extends RecursiveDirectoryIterator
* \ArrayObject
private $dirArray;
public function __construct(string $path)
You can’t perform that action at this time.