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>;
}
@sovetski
sovetski / README.md
Created July 30, 2025 21:22 — forked from aidos-dev/README.md
How to connect Apple AirPods to Linux (Debian/Ubuntu/Mint)

How to connect Apple AirPods to Linux (Debian/Ubuntu/Mint)

Step 1.

Open your terminal.

In the root directory run the command:

sudo nano /etc/bluetooth/main.conf
@sovetski
sovetski / remove-parent-link-from-submenu.php
Created December 21, 2025 18:52 — forked from renventura/remove-parent-link-from-submenu.php
This removes a parent menu link from its submenu in the WordPress admin.
@sovetski
sovetski / main.py
Created April 5, 2026 15:21
YouTube auto thumbnail and title update depending on the current views
import os
import time
import pickle
import datetime
from PIL import Image, ImageDraw, ImageFont
from googleapiclient.discovery import build
from googleapiclient.http import MediaFileUpload
# Source and destination video IDs
SOURCE_VIDEO_ID = "XXX"
@sovetski
sovetski / async-v2.php
Created April 5, 2026 15:37 — forked from devhammed/async-v2.php
Async PHP v2 (This is another attempt at Async PHP using stream socket pair capabilities.
<?php
declare(strict_types=1);
function async(Closure $task): Closure
{
static $resolved = [];
static $id = 0;