Skip to content

Instantly share code, notes, and snippets.

View DragonBe's full-sized avatar
:octocat:
The next step…

M van Dam DragonBe

:octocat:
The next step…
View GitHub Profile
@DragonBe
DragonBe / azure-sdk-commands.md
Created December 1, 2017 08:38
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
DragonBe / dnt-check.php
Created October 20, 2017 08:34
Functionality to verify if "Do not track" is set in the browser configuration.
<?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 September 7, 2017 18:51
Jenkins plugins preloader for Jenkins Docker image
ant
bouncycastle-api
build-timeout
checkstyle
cloverphp
crap4j
credentials-binding
credentials
docker-commons
docker-workflow
@DragonBe
DragonBe / FinalClass.php
Created July 20, 2017 15:05
Testing final classes is tricky, but possible even though you cannot directly mock a "final" class
<?php
namespace FinalClass;
require_once __DIR__ . '/vendor/autoload.php';
use PHPUnit\Framework\TestCase;
final class Foo
{
protected $bar;
@DragonBe
DragonBe / SortableDirectoryIterator.php
Created June 22, 2017 21:23
Sortable DirectoryIterator based on last modification time
class SortableDirectoryIterator extends RecursiveDirectoryIterator
{
/**
* \ArrayObject
*/
private $dirArray;
public function __construct(string $path)
{
parent::__construct($path);
@DragonBe
DragonBe / php_conferences_fall_2017.md
Last active June 29, 2017 16:46
Overview of PHP conferences in the fall of 2017
@DragonBe
DragonBe / php_apache_homebrew.md
Last active November 20, 2022 18:15
Installation of Apache 2.4 and PHP 7.1 with Homebrew

I posted several talks about compiling PHP from source, but everyone was trying to convince me that a package manager like Homebrew was a more convenient way to install.

The purpose of Homebrew is simple: a package manager for macOS that will allow you to set up and install common packages easily and allows you to update frequently using simple commands.

I used a clean installation of macOS Sierra to ensure all steps could be recorded and tested. In most cases you already have done work on your Mac, so chances are you can skip a few steps in this tutorial.

Apache and PHP with homebrew

I’ve made this according to the installation instructions given on GetGrav.

@DragonBe
DragonBe / cache.global.php
Created February 2, 2017 19:32
Zend Framework configuration for Redis cache
<?php
return [
'caches' => [
'cache_longterm' => [
'adapter' => \Zend\Cache\Storage\Adapter\Redis::class,
'options' => [
'server' => [
'host' => getenv('APP_REDIS_HOST'),
'port' => getenv('APP_REDIS_PORT'),

Verloren maandag bestelling

Image Label Description Price
dubbel worstenbrood Dubbel Worstenbrood Two beef/pork sausages wrapped in a very tasty puff pastry. 3.90
enkel worstenbrood Enkel Worstenbrood A single beef/pork sausage wrapped in a very tasty puff pastry. 2.55
appelbol Appelbol An sweetened apple wrapped in a very tasty puff pastry. 2.55
@DragonBe
DragonBe / php_conferences_spring_2017.md
Last active February 23, 2017 13:02
Easy planning your conferences start of 2017