Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Coding

Matthias Pigulla mpdude

💭
Coding
View GitHub Profile
@mpdude
mpdude / my-workflow.yml
Last active Sep 6, 2019
Setup a SSH deploy key so that workflow steps can fetch dependencies from private GitHub repos
View my-workflow.yml
# .github/workflows/my-workflow.yml
# ... other config here
jobs:
build:
runs-on: ubuntu-18.04
steps:
- uses: actions/checkout@v1
- name: Setup SSH Keys and known_hosts
env:
SSH_AUTH_SOCK: /tmp/ssh_agent.sock
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 Jan 12, 2022
~/.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
# Shortcut für: Bei einem SSH-Login auf einer anderen Maschine, den eigenen
# SSH-Schlüssel mitnehmen (z.B. damit man dort dann ein per SSH ausgechecktes