Skip to content

Instantly share code, notes, and snippets.

:octocat:
The next step…

Michelangelo van Dam DragonBe

:octocat:
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
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|
config.vm.box = "debian/jessie64"
config.vm.hostname = "jenkins-php7"
config.vm.network "private_network", ip: "192.168.121.4"
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
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!
VAGRANTFILE_API_VERSION = "2"
Vagrant.require_version ">= 2.2.0"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vagrant.plugins = ["vagrant-vbguest"]
@DragonBe
DragonBe / gitarchive.sh
Created Jun 7, 2018
Creating a GPG signed archive of your GIT source code with SHA 256 checksums in bash
View gitarchive.sh
#!/bin/bash
# Getting the current project's directory
pf=$(printf '%q\n' "${PWD##*/}")
# Getting the current configured user's email
gpguser=$(git config user.email)
if [ -z $gpguser ]
then
echo "!!! ERROR: No user for GIT configured !!!"
@DragonBe
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 :
VAGRANTFILE_API_VERSION = '2'
@script = <<SCRIPT
# Fix for https://bugs.launchpad.net/ubuntu/+source/livecd-rootfs/+bug/1561250
if ! grep -q "ubuntu-xenial" /etc/hosts; then
echo "127.0.0.1 ubuntu-xenial" >> /etc/hosts
fi
@DragonBe
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|
config.vm.box = "debian/jessie64"
config.vm.host_name = "phpvm"
config.vm.box_check_update = false
config.vm.network "private_network", ip: "192.168.33.67"
config.vm.provider "virtualbox" do |vb|
vb.memory = "1024"
@DragonBe
DragonBe / azure-sdk-commands.md
Created Dec 1, 2017
Basic Microsoft Azure CLI/SDK commands to quickly launch a web app on Azure cloud services
View azure-sdk-commands.md
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
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
<?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
DragonBe / plugins.txt
Created Sep 7, 2017
Jenkins plugins preloader for Jenkins Docker image
View plugins.txt
ant
bouncycastle-api
build-timeout
checkstyle
cloverphp
crap4j
credentials-binding
credentials
docker-commons
docker-workflow
@DragonBe
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
<?php
namespace FinalClass;
require_once __DIR__ . '/vendor/autoload.php';
use PHPUnit\Framework\TestCase;
final class Foo
{
protected $bar;
@DragonBe
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)
{
parent::__construct($path);
You can’t perform that action at this time.