Skip to content

Instantly share code, notes, and snippets.

The next step…

M van Dam DragonBe

The next step…
View GitHub Profile
DragonBe / azure-ad-connect.php
Last active May 17, 2022
A simple PoC to access Azure AD for authentication
View azure-ad-connect.php
use League\OAuth2\Client\Provider\GenericProvider;
use Microsoft\Graph\Graph;
use Microsoft\Graph\Model;
const OAUTH_APP_ID = '';
DragonBe /
Last active Aug 16, 2021
The common pattern for user registration, sign in, reset and removal of an account written out

Auth Stnadard Requirements

Problem statement

To tackle the common application pattern for authenticating, registering, resetting credentials, verifying, and unregistering from an application, the common patterns exists but many implementations make it hard to use the best solutions of different frameworks. While almost each application has this requirement, no standard has been defined.

Possible reasons why it's difficult

  • Too many backend solutions for storing and updating credentials (DB, LDAP/AD, API, SSO, SAML, …)
  • Added complexity when authorisation is required
  • Added complexity when MFA is required
DragonBe / azureConnectionStringToPdo.php
Created May 2, 2021
Convert an Azure Connection String for MySQL into a PDO resource
View azureConnectionStringToPdo.php
* Example usage:
* $connString = 'Database=localdb;Data Source=;User Id=dbuser;Password=$3cR37!';
* $pdo = azureConnectionStringToPdo($connString);
DragonBe / WooCommerce Plugin Privacy Checker
Created May 10, 2020
Here's a step-by-step process to check if a WooCommerce plugin adopts the privacy functionality provided by the platform by extending WC_Abstract_Privacy.
View WooCommerce Plugin Privacy Checker

Plugins checker

This is a small report about plugins I've verified with phpdoc for extending WC_Abstract_Privacy privacy class provided by WooCommerce.

Based on information found in WooCommerce Guidelines for GDPR, Making Woo Extensions GDPR compliant and the whole WC_Abstract_Privacy class API.

Plugins not extending the privacy class

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 Dec 5, 2021
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>