This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/php | |
<?php | |
$files = shell_exec('git diff-index --name-only --cached --diff-filter=ACMR HEAD | grep "\.php$"'); | |
$files = explode("\n", trim($files)); | |
$exitCode = 0; | |
foreach ($files as $file) { | |
if (empty($file)) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
echo "php-cs-fixer pre commit hook start" | |
PHP_CS_FIXER="bin/php-cs-fixer" | |
PHP_CS_CONFIG=".php_cs" | |
CHANGED_FILES=$(git diff --cached --name-only --diff-filter=ACM -- '*.php') | |
if [ -n "$CHANGED_FILES" ]; then | |
$PHP_CS_FIXER fix --config "$PHP_CS_CONFIG" $CHANGED_FILES; | |
git add $CHANGED_FILES; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use PhpCsFixer\Config; | |
use PhpCsFixer\Finder; | |
$rules = [ | |
'array_indentation' => true, | |
'array_syntax' => ['syntax' => 'short'], | |
'binary_operator_spaces' => [ | |
'default' => 'single_space', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Thanks to https://www.growingwiththeweb.com/2018/01/slow-nvm-init.html, modified | |
# for zsh as "type -t" works in bash but not zsh | |
# Add this to your .zshrc ... | |
# Defer initialization of nvm until nvm, node or a node-dependent command is | |
# run. Ensure this block is only run once if .bashrc gets sourced multiple times | |
# by checking whether __init_nvm is a function. | |
if [ -s "$HOME/.nvm/nvm.sh" ] && [ ! "$(type -w __init_nvm | awk '{print $2}')" = function ]; then |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mix = require('laravel-mix'); | |
const tailwindcss = require('tailwindcss'); | |
const rootPath = Mix.paths.root.bind(Mix.paths); | |
const tailwindPlugins = function(configFile, paths) { | |
const pluginList = [tailwindcss(configFile)]; | |
if (mix.inProduction()) { | |
pluginList.push(require('@fullhuman/postcss-purgecss')({ |