Skip to content

Instantly share code, notes, and snippets.

💭
Coding

Matthias Pigulla mpdude

💭
Coding
Block or report user

Report or block mpdude

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
View secrets.yaml
parameters:
env(SECRETS_FILE): .secrets.php
services:
# default configuration for services in *this* file
_defaults:
autowire: true # Automatically injects dependencies in your services.
autoconfigure: true # Automatically registers your services as commands, event subscribers, etc.
bind:
$someSecret: '%env(key:KEY3:require:SECRETS_FILE)%'
View gist:1ad1c03556d9fd4191396159b7929124
diff --git a/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php b/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php
index 571f16232..bf823e56d 100644
--- a/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php
+++ b/lib/Doctrine/DBAL/Driver/Mysqli/MysqliStatement.php
@@ -87,10 +87,10 @@ class MysqliStatement implements \IteratorAggregate, Statement
protected $_values = [];
/**
- * Contains values from bindValue() that need to be sent
+ * Contains streams passed to bindValue() that need to be sent
@mpdude
mpdude / symfony.xml
Created Sep 6, 2018
Symfony code style settings for PhpStorm
View symfony.xml
<code_scheme name="Project" version="173">
<option name="RIGHT_MARGIN" value="150" />
<PHPCodeStyleSettings>
<option name="ALIGN_KEY_VALUE_PAIRS" value="true" />
<option name="ALIGN_PHPDOC_PARAM_NAMES" value="true" />
<option name="ALIGN_PHPDOC_COMMENTS" value="true" />
<option name="COMMA_AFTER_LAST_ARRAY_ELEMENT" value="true" />
<option name="PHPDOC_BLANK_LINES_AROUND_PARAMETERS" value="true" />
<option name="LOWER_CASE_BOOLEAN_CONST" value="true" />
<option name="LOWER_CASE_NULL_CONST" value="true" />
View gist:aeef5c641d27e26b4aabf39cb87ccde3
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="PublishConfigData" serverName="wf-development-vm">
<serverData>
<paths name="wf-development-vm">
<serverdata>
<mappings>
<mapping deploy="/var/www" local="$PROJECT_DIR$/../" web="/" />
</mappings>
</serverdata>
View gist:3c7d1529f135ade5492a63992d30a1ba
#!/bin/bash -e
pushd . > /dev/null
INTERPRETER=/usr/bin/php
while [ "`pwd`" != "/" ]; do
if [ -x ./bin/php ]; then
INTERPRETER=`pwd`/bin/php
break
fi
cd ..
done
@mpdude
mpdude / srsd
Last active May 21, 2018
init script for srsd
View srsd
#!/bin/bash
### BEGIN INIT INFO
# Provides: srsd
# Required-Start: $networking $local_fs $remote_fs $syslog
# Required-Stop: $networking $local_fs $remote_fs $syslog
# Should-Start:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: SRS daemon
@mpdude
mpdude / renamedb
Created Apr 24, 2018 — forked from centminmod/renamedb
renamedb
View renamedb
#!/bin/bash
# Copyright 2013 Percona LLC and/or its affiliates
set -e
if [ -z "$3" ]; then
echo "rename_db <server> <database> <new_database>"
exit 1
fi
db_exists=`mysql -h $1 -e "show databases like '$3'" -sss`
if [ -n "$db_exists" ]; then
echo "ERROR: New database already exists $3"
@mpdude
mpdude / docker-cleanup-resources.md
Created Mar 24, 2018 — forked from bastman/docker-cleanup-resources.md
docker cleanup guide: containers, images, volumes, networks
View docker-cleanup-resources.md

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
@mpdude
mpdude / .profile
Last active Apr 10, 2018
~/.profile für OS X
View .profile
# ~/.profile wird bei jedem Shell-Start ausgeführt
# (In der Bash: NUR ausgeführt, wenn ~/.bash_profile nicht existiert)
# Autocompletion z. B. auch für SSH-Hostnamen
if [ -f $(brew --prefix)/etc/bash_completion ]; then
. $(brew --prefix)/etc/bash_completion
fi
# Einige Aliase, vgl. auch https://webfactory.kilnhg.com/Code/server-management/Group/puppet-manifests/Files/modules/shell/files/webfactory-common-profile?rev=tip
# In virtualbox und auf den Servern kommt das automatisch über Puppet.
@mpdude
mpdude / gist:248322fd78cba94ef68994d30a3b3180
Created Nov 24, 2016
Fix libxml 2.9.2 regression with relative URI handling and file:// URLs
View gist:248322fd78cba94ef68994d30a3b3180
diff --git a/uri.c b/uri.c
index 2bd5720..6e09018 100644
--- a/uri.c
+++ b/uri.c
@@ -2024,7 +2024,7 @@ xmlBuildURI(const xmlChar *URI, const xmlChar *base) {
}
if (bas->authority != NULL)
res->authority = xmlMemStrdup(bas->authority);
- else if (bas->server != NULL) {
+ else if ((bas->server != NULL) || (bas->port == -1)) {
You can’t perform that action at this time.