Skip to content

Instantly share code, notes, and snippets.

View sovetski's full-sized avatar
🎯
Focusing

Ahliman HUSEYNOV 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
@sovetski
sovetski / php-event-listener-example.php
Created August 18, 2024 18:18 — forked from im4aLL/php-event-listener-example.php
PHP event listener simple example
<?php
// Used in https://github.com/im4aLL/roolith-event
class Event {
private static $events = [];
public static function listen($name, $callback) {
self::$events[$name][] = $callback;
}
@sovetski
sovetski / background.jsx
Created August 24, 2024 16:05
Add a background for scene in react fiber (r3f)
import { Canvas, useLoader } from "@react-three/fiber";
export default function Scene() {
const backgroundImage = useLoader(THREE.TextureLoader, "/bg.png");
return <Canvas scene={{ background: backgroundImage }}>...</Canvas>;
}