Skip to content

Instantly share code, notes, and snippets.

Enjoying my new job :)


Enjoying my new job :)
View GitHub Profile
burzum /
Last active Jan 6, 2021
Install php versions and modules automatically on Ubuntu
#!/usr/bin/env bash
phpVersions=('7.2' '7.3' '7.4')
modules=('cli' 'fpm' 'bcmath' 'gd' 'xml' 'mbstring' 'xml' 'curl' 'pgsql' 'imagick' 'intl' 'amqp' 'intl' 'imap' 'opcache')
sudo apt-get update
sudo apt -y install software-properties-common
sudo add-apt-repository -y ppa:ondrej/php
View Query.php
public function applyOptions(array $options)
$valid = [
'fields' => 'select',
'conditions' => 'where',
'join' => 'join',
'order' => 'order',
'limit' => 'limit',
'offset' => 'offset',
'group' => 'group',
View eventstore-v8.php
use GuzzleHttp\Client as GuzzleClient;
use Http\Adapter\Guzzle6\Client;
use Prooph\EventStore\ExpectedVersion;
use Prooph\EventStore\EventData;
use Prooph\EventStore\UserCredentials;
use Prooph\EventStoreHttpClient\ConnectionSettings;
use Prooph\EventStoreHttpClient\EventStoreConnectionFactory;
$userCredentials = new UserCredentials('admin', 'changeit');
View test.php
namespace Authentication\Test\TestCase\Identifier\Resolver;
use Authentication\Identifier\Resolver\EloquentResolver;
use Authentication\Test\TestCase\AuthenticationTestCase;
use Illuminate\Database\Capsule\Manager as Capsule;
use Illuminate\Database\Connection;
use Illuminate\Database\ConnectionResolverInterface;
use Illuminate\Database\Eloquent\Model;
burzum / ElasticPaginator.php
Created Aug 21, 2017
CakePHP ES Paginator
View ElasticPaginator.php
namespace App\Datasource;
use Cake\Datasource\Paginator;
use Cake\Datasource\RepositoryInterface;
use Cake\ElasticSearch\Query;
use Cake\Network\Exception\NotFoundException;
burzum / phpcs.xml
Last active Jul 17, 2017
Custom phpcs config for PSR2 without the god damn aweful spaces - enforce tabs!
View phpcs.xml
<?xml version="1.0"?>
<ruleset name="PSR2-Fuck-Spaces">
<rule ref=".\vendor\cakephp\cakephp-codesniffer\CakePHP\ruleset.xml"/>
<rule ref="PSR2">
<exclude name="PSR2.Classes.ClassDeclaration"></exclude>
<exclude name="Generic.WhiteSpace.DisallowTabIndent"/>
<exclude name="Squiz.Functions.MultiLineFunctionDeclaration.BraceOnSameLine" />
burzum / src\Pdf\Engine\TexToPdfEngine.php
Last active Dec 10, 2015
View src\Pdf\Engine\TexToPdfEngine.php
namespace App\Pdf\Engine;
use CakePdf\Pdf\CakePdf;
use CakePdf\Pdf\Engine\AbstractPdfEngine;
use Cake\Core\Exception\Exception;
use Cake\Utility\Text;
* TexToPdfEngine for the CakePdf Plugin
View Table\TablePrefixTrait.php
namespace App\Model\Table;
use Cake\Core\Configure;
* Database Prefix Trait for CakePHP 3.0
* @author Florian Krämer
* @license MIT
burzum / DbPrefixTrait.php
Created Aug 7, 2015
CakePHP 3.0 DB Connection Prefix
View DbPrefixTrait.php
namespace App\Model\Table;
use Cake\Core\Configure;
* Database Prefix Trait for CakePHP 3.0
* @author Florian Krämer
* @license MIT