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 / fix-cs-php.yml
Last active May 14, 2024 22:20
GitHub Actions workflow to open PRs for php-cs-fixer changes
# Update this by running
# curl https://gist.github.com/mpdude/ca93a185bcbf56eb7e341632ad4f8263/raw/fix-cs-php.yml > .github/workflows/fix-cs-php.yml
on:
push:
branches:
- master
pull_request:
name: Coding Standards
@mpdude
mpdude / projekt-img.sh
Last active May 12, 2020 13:29 — forked from scottsb/casesafe.sh
Create and manage a case-sensitive disk-image on macOS (OS X).
#!/bin/bash -e
# ---------------------------------------------------------
# Customizable Settings
# ---------------------------------------------------------
MOUNT_POINT="${CASE_SAFE_MOUNT_POINT:-${HOME}/Projekte}"
VOLUME_PATH="${CASE_SAFE_VOLUME_PATH:-${HOME}/.Projekte.sparsebundle}"
VOLUME_NAME="${CASE_SAFE_VOLUME_NAME:-Projekte}"
VOLUME_SIZE="${CASE_SAFE_VOLUME_SIZE:-200g}"
@mpdude
mpdude / ssh-deploy-key-wrapper.sh
Last active June 26, 2022 05:20
Wrapper around `ssh` to pick the right one from several GitHub deploy keys
#!/bin/bash
# The last argument is the command to be executed on the remote end, which is something
# like "git-upload-pack 'webfactory/ssh-agent.git'". We need the repo path only, so we
# loop over this last argument to get the last part of if.
for last in ${!#}; do :; done
# Don't use "exec" to run "ssh" below; then the trap won't work.
key_file=$(mktemp -u)
trap "rm -f $key_file" EXIT
-----BEGIN PGP PUBLIC KEY BLOCK-----
mDMEYLvsoRYJKwYBBAHaRw8BAQdAfGlCQI9xzi6s/JSfkcE19grdeW3Xf/hIUv1T
Czfgo+G0I01hdHRoaWFzIFBpZ3VsbGEgPG1wQHdlYmZhY3RvcnkuZGU+iI4EExYK
ADYCGwEECwkIBwQVCgkIBRYCAwEAAh4BAheAFiEEhU82pmfobc+YBhNGhc7z7F2f
JHwFAmC/A1UACgkQhc7z7F2fJHxfywD+KimyGRa5Fv4NyS+eXRE+5xIy0q+SeMkQ
djU36a1jVfIA/RNkseAmUe3BB9xavrBklwxetynXtjUZsIzmwaxyFyUAuDMEYLvt
jhYJKwYBBAHaRw8BAQdAPeAqSij5tu/5ol3zmeFCU98g5U3LCAqPIfVsstH7g6aI
7wQYFgoAIAIbAhYhBIVPNqZn6G3PmAYTRoXO8+xdnyR8BQJgvwNiAIF2IAQZFgoA
HRYhBIW5u5oK9SUa2Pft5wdiXbCBXWyhBQJgu+2OAAoJEAdiXbCBXWyh43cBAKyp
@mpdude
mpdude / README.md
Created January 18, 2022 20:52
Use `jq` to tweak `composer.json` requirements

Change Symfony requirements in composer.json

This took me two hours on stackoverflow.com, so I'm going to document it to future me:

In the composer.json require section, for all packages starting with symfony/, but not for symfony/monolog-bundle, change the required version to the value of the $VERSION environment variable.

Write out the updated composer.json file in a way that works _without sponge`, which is not installed on GitHub Action runners by default.

@mpdude
mpdude / fix-php-cs.yml
Created May 20, 2022 08:57
Run PHP-CS-Fixer on PRs and commit/push back changes
# .github/workflows/fix-php-cs.yml
on:
pull_request:
name: Coding Standards
jobs:
open-pr-for-cs-violations:
name: PHP-CS-Fixer
runs-on: ubuntu-20.04