Skip to content

Instantly share code, notes, and snippets.

View sovetski's full-sized avatar
🎯
Focusing

Human HUMANOV sovetski

🎯
Focusing
View GitHub Profile
@sovetski
sovetski / post-commit
Last active August 31, 2023 08:58
Run husky after any commit, it will run php cs fixer only on the staged files and let you test before committing the formatted verison
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
git diff --name-only HEAD~1..HEAD | grep '\.php$' | xargs ./tools/php-cs-fixer/vendor/bin/php-cs-fixer fix --config=my_config.php_cs.dist
# You should create a file named "post-commit" in your ".husky" directory
# Change the "my_config.php_cs.dist" by your config file
# Or use this one to exlude "vendor" and "tools" directories
# git diff --name-only HEAD~1..HEAD | grep '\.php$' | grep -Ev '^vendor/|^tools/' | xargs ./tools/php-cs-fixer/vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php
@sovetski
sovetski / .gitignore
Created June 21, 2023 12:24 — forked from SaltwaterC/.gitignore
php cache curl
/cache/
@sovetski
sovetski / .env
Created May 17, 2024 19:21 — forked from jfcherng/.env
Symfony 5 maintenance mode
MAINTENANCE_MODE=0
@sovetski
sovetski / gist:f3da88244648585d1d801436e0f0668b
Created May 23, 2024 09:56
Git: Delete previous commit
# ALWAYS git pull before doing it
git pull
git reset HEAD^ --hard
git push origin -f