Skip to content

Instantly share code, notes, and snippets.

View hollodotme's full-sized avatar
🧑‍💻
On it

Holger Woltersdorf hollodotme

🧑‍💻
On it
View GitHub Profile
@hollodotme
hollodotme / keybase.md
Created October 28, 2017 16:03
Keybase.io Verification

Keybase proof

I hereby claim:

  • I am hollodotme on github.
  • I am hollodotme (https://keybase.io/hollodotme) on keybase.
  • I have a public key whose fingerprint is 38F8 06CE 3071 114C 991A 6C2F B878 F8C0 C810 7679

To claim this, I am signing this object:

@hollodotme
hollodotme / PassthroughCallbackWithTimedBuffer.php
Created April 17, 2018 19:45
Passthrough callback with timed buffer
<?php declare(strict_types=1);
final class TimedBuffer
{
private $buffer = '';
private $intervalMs;
private $startTime;
@hollodotme
hollodotme / GroupedTestDox.md
Last active May 6, 2018 21:42
PHPUnit Testdox mit gruppierten Data-Sets im Markdown-Format

😊 Passed | 🤬 Error | 😡 Failure | 😠 Warning | 🧐 Risky | 😶 Incomplete | 🤫 Skipped

Test suite: Unit

  • Environment: Development
  • Base namespace: Fortuneglobe\Prometheus\Exporters\Tests

Unit\Application\Metrics\GaugeListTest

  • Can Get Metric String For Multiple Gauges (😊 1)
# prepare
$ sudo apt-get install -y linux-headers-generic build-essential dkms
# get the right ISO from http://download.virtualbox.org/virtualbox/
$ wget http://download.virtualbox.org/virtualbox/5.2.8/VBoxGuestAdditions_5.2.8.iso
# create a mount folder
$ sudo mkdir /media/VBoxGuestAdditions
# mount the ISO
$ sudo mount -o loop,ro VBoxGuestAdditions_5.2.8.iso /media/VBoxGuestAdditions
# install the guest additions
<?php declare(strict_types=1);
if (
extension_loaded( 'xdebug' )
&& version_compare( '2.6.0', phpversion( 'xdebug' ), '<=' )
)
{
/** @noinspection PhpUndefinedFunctionInspection */
/** @noinspection PhpUndefinedConstantInspection */
xdebug_set_filter(
@hollodotme
hollodotme / .travis.yml
Last active January 14, 2019 10:40
Using xdebug filter for code coverage on travis-ci
language: php
php:
- 7.1
- 7.2
branches:
only:
- master
- development
@hollodotme
hollodotme / generatorForEach.php
Created November 7, 2018 19:24
Comparison of generator with foreach and yield from
<?php declare(strict_types=1);
class Test
{
private $arr = [];
public function __construct()
{
for ( $i = 0; $i < 10000; $i++ )
{
@hollodotme
hollodotme / phplint.sh
Last active December 17, 2020 08:29
PHP linting shell script - suitable for usage in PHP alpine docker containers
#!/usr/bin/env sh
OPTIND=1
EXITCODE=0
# Default parallelization
PARALLELIZE=2
# Default file name pattern
FILENAME_PATTERN='*.php'
echo "PHP linting - looking for syntax errors in PHP files."

Signing github releases

git config --global user.signingkey you@email.domain

# Now you can make a release as normal, but with a signed commit.
git tag -s v0.1 -m "the best version yet"

# The only difference here is the -s. 
# Before you upload the tag be sure to check your signature with 
@hollodotme
hollodotme / Install-nginx-with-http2-support.md
Created April 9, 2016 17:07
Install nginx with http2 support on ubuntu 14.04 LTS (Trusty)

How to install nginx (>= 1.9.5) with http2 support on Ubuntu 14.04 LTS (Trusty)

IMPORTANT: Backup your nginx site configs (usually under /etc/nginx/sites-available)!

Remove old nginx

Remove old nginx incl. nginx-common:

apt-get autoremove --purge nginx nginx-common