Skip to content

Instantly share code, notes, and snippets.

Avatar

Paul Redmond paulredmond

View GitHub Profile
@paulredmond
paulredmond / .php_cs
Last active Mar 8, 2020
My PHP CS Fixer setup for Laravel
View .php_cs
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'phpdoc_indent' => true,
'binary_operator_spaces' => [
'operators' => ['=>' => null]
],
View .prettierrc.js
module.exports = {
semi: false,
singleQuote: true,
trailingComma: "es5",
tabWidth: 2,
}
@paulredmond
paulredmond / partial-mock-live-template.php
Created Jan 22, 2020
Laravel partialMock() live template for PhpStorm
View partial-mock-live-template.php
$this->partialMock($ABSTRACT$, function ($mock) {
/* @var \Mockery\MockInterface|\Mockery\LegacyMockInterface $mock */
$END$
});
@paulredmond
paulredmond / Dockerfile
Created Nov 26, 2019
Example of a Laravel multi-stage build
View Dockerfile
FROM composer:1.7 as vendor
COPY database/ database/
COPY composer.json composer.json
COPY composer.lock composer.lock
RUN composer install \
--ignore-platform-reqs \
--no-interaction \
@paulredmond
paulredmond / README.md
Created Nov 19, 2019 — forked from tomazzaman/README.md
Kill supervisor on Docker when any of the services fail
View README.md

Killing supervisor if any of it's child processes fail

The trick is to only register the listener for events that indicate failure, namely

  • PROCESS_STATE_STOPPED
  • PROCESS_STATE_EXITED
  • PROCESS_STATE_FATAL

Once they do, we should send a SIGQUIT to Supervisor.

@paulredmond
paulredmond / docker.conf
Last active Apr 25, 2020
Example www pool for PHP-FPM with dynamic Environment variables
View docker.conf
; if you're using the starter bundle file `docker/php/php-fpm.d/docker.conf`
[global]
daemonize = no
pid = run/php-fpm.pid
[www]
listen = /usr/local/var/run/php-fpm.sock
listen.owner = www-data
listen.group = www-data
listen.mode = 0660
View keybase.md

Keybase proof

I hereby claim:

  • I am paulredmond on github.
  • I am predmond (https://keybase.io/predmond) on keybase.
  • I have a public key ASB3-pszs0G8t6ewAOIPFlPHB2fAngS9jXWCk36UD3KoNAo

To claim this, I am signing this object:

@paulredmond
paulredmond / .php_cs.laravel.php
Created Jun 21, 2019 — forked from laravel-shift/.php_cs.laravel.php
PHP CS Fixer - Laravel Ruleset
View .php_cs.laravel.php
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'phpdoc_indent' => true,
'binary_operator_spaces' => [
'operators' => ['=>' => null]
],
@paulredmond
paulredmond / sublime-merge-cli.sh
Last active Sep 30, 2018
Put smerge in your path on OS X - Sublime Merge CLI
View sublime-merge-cli.sh
#!/usr/bin/env bash
ln -s /Applications/Sublime\ Merge.app/Contents/SharedSupport/bin/smerge /usr/local/bin/smerge
@paulredmond
paulredmond / may-mayhem-contest-articles.md
Created Jun 4, 2018
The complete list of articles submitted to the Laravel Blog Contest - May Mayhem Edition 2018
View may-mayhem-contest-articles.md
You can’t perform that action at this time.