Skip to content

Instantly share code, notes, and snippets.

@jackbentley
jackbentley / InstallTask.php
Last active March 16, 2023 16:53
Custom task in grumphp-shim
#!/usr/bin/env php
<?php
$phar = new Phar('vendor/phpro/grumphp-shim/grumphp.phar');
$phar->addFile('MyCustom.php', 'src/Task/MyCustom.php');
$newAutoloaderContent = <<<FILE
'GrumPHP\\Task\\MyCustom' => __DIR__ . '/../..' . '/src/Task/MyCustom.php',
FILE;
@jackbentley
jackbentley / file.txt
Last active February 26, 2021 01:26
markdown-it-py reproducer
1. FooBar
> FooBar
2. FooBar
> FooBar
@jackbentley
jackbentley / post-commit
Last active November 19, 2018 12:40
Post commit hook for PHP CS Fixer. This will only run CS fixer on the changes made in the last commit.
#!/usr/bin/env bash
if [[ -z "${IN_HOOK}" ]]; then
export IN_HOOK='yes'
REQUIRES_UNSTASH=''
if [[ ! -z "$(git diff --no-commit-id --name-only)" ]]; then
REQUIRES_UNSTASH='yes'
echo '[] stash'
@jackbentley
jackbentley / steamcmd
Created September 30, 2018 22:57
Steamcmd
#!/bin/sh
# Copyright (C) 2015 Alexandre Detiste <alexandre@detiste.be>
# License: MIT
# create a fake Steam installation to avoid
# that steamcmd uses "/home/$user/Steam" instead
if [ ! -e ~/.steam ]
then
mkdir -p ~/.steam/appcache/
mkdir -p ~/.steam/config/