Skip to content

Instantly share code, notes, and snippets.

View mpdude's full-sized avatar
💭
Coding

Matthias Pigulla mpdude

💭
Coding
View GitHub Profile
@mpdude
mpdude / README.md
Last active May 2, 2021 02:42
`phpinfo` output for various PHP versions shipped with GitHub Actions
@mpdude
mpdude / draft.md
Created September 25, 2019 19:18

Question on how to best build Docker images

Initial situation

In most of my projects I need to run a few steps after I checkout the code from version control and before I can actually use (or work on) it. Examples include

  • run composer, npm, yarn, ... to fetch dependencies
  • run grunt, gulp or similar front-end build pipelines
  • run some legacy code generation tools 🙀
@mpdude
mpdude / my-workflow.yml
Last active August 25, 2023 13:00
Setup a SSH deploy key so that workflow steps can fetch dependencies from private GitHub repos
# .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
@mpdude
mpdude / secrets.yaml
Created April 6, 2019 13:09 — forked from nicolas-grekas/secrets.yaml
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)%'
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 September 6, 2018 20:30
Symfony code style settings for PhpStorm
<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" />
<?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>
#!/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 20:36
init script for 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 April 24, 2018 13:42 — forked from centminmod/renamedb
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"