Skip to content

Instantly share code, notes, and snippets.

View w3spi5's full-sized avatar
🏠
Working from home

Ɛɔıs3 w3spi5

🏠
Working from home
View GitHub Profile
@w3spi5
w3spi5 / digitized_video_enhancement_script.sh
Last active March 22, 2025 03:57
Hi8/VHS digitized video enhancement script
#!/bin/bash
# Hi8 digitized video enhancement script
# Created on March 22, 2025
# Enhancement parameters configuration
SATURATION=1.2 # Saturation value (1.0 = normal, 1.2 = +20%)
CONTRAST=1.1 # Contrast value (1.0 = normal, 1.1 = +10%)
BRIGHTNESS=0.05 # Brightness adjustment (-1.0 to 1.0)
VIDEO_DENOISING="4:3:6:3" # Denoising parameters (strength:spatial:temporal:spatial)
VIDEO_QUALITY=18 # CRF - lower = better quality (18-23 recommended)
@w3spi5
w3spi5 / utf8ize.php
Last active March 10, 2024 17:25
Recursively converts data (strings, arrays, objects) to UTF-8 encoding.
<?php
/**
* Related with utf8 problems and based on differents answers from https://stackoverflow.com/a/19366999/3452348
* This function is at the time of writing, for me, the best improved version existing actually.
*
* This function is designed to uniformly encode data as UTF-8. It handles strings by attempting
* to detect the current encoding and converting it to UTF-8. For arrays and objects, it applies
* the conversion recursively to each element or property. The function tries a predefined list
* of common encodings if automatic detection fails. Note that only public properties of objects
@w3spi5
w3spi5 / isLocal.php
Last active March 10, 2024 17:32
PHP - One line static function to check if you are in local or prod env
<?php
public static function isLocal(): bool
{
return in_array($_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1']);
}