Skip to content

Instantly share code, notes, and snippets.

paulredmond / .zshrc
Last active Jul 12, 2021
Aliases to clear Laravel logs
View .zshrc
# Must run from the root of a Laravel app
alias clearlog="truncate -s 0 $PWD/storage/logs/laravel.log"
alias clearlogs="truncate -s 0 $PWD/storage/logs/*.log"
# Or using git rev-parse
alias clearlog="truncate -s 0 $(git rev-parse --show-toplevel)/storage/logs/laravel.log"
alias clearlogs="truncate -s 0 $(git rev-parse --show-toplevel)/storage/logs/*.log"
paulredmond / .php_cs
Last active Mar 8, 2020
My PHP CS Fixer setup for Laravel
View .php_cs
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 / 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 */
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 /
Created Nov 19, 2019 — forked from tomazzaman/
Kill supervisor on Docker when any of the services fail

Killing supervisor if any of it's child processes fail

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


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

paulredmond / docker.conf
Last active Jun 9, 2021
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`
daemonize = no
pid = run/
listen = /usr/local/var/run/php-fpm.sock
listen.owner = www-data = www-data
listen.mode = 0660

Keybase proof

I hereby claim:

  • I am paulredmond on github.
  • I am predmond ( on keybase.
  • I have a public key ASB3-pszs0G8t6ewAOIPFlPHB2fAngS9jXWCk36UD3KoNAo

To claim this, I am signing this object:

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
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'phpdoc_indent' => true,
'binary_operator_spaces' => [
'operators' => ['=>' => null]
paulredmond /
Last active Sep 30, 2018
Put smerge in your path on OS X - Sublime Merge CLI
#!/usr/bin/env bash
ln -s /Applications/Sublime\ /usr/local/bin/smerge