Skip to content

Instantly share code, notes, and snippets.

View shole's full-sized avatar
🎩

Paavo Happonen shole

🎩
View GitHub Profile
@shole
shole / QuakeLightFlicker.cs
Last active June 18, 2021 15:27
Inspired
using UnityEditor;
using UnityEngine;
/*
Implements original Quake light flickering in Unity.
Inspired by this blog post
https://80.lv/articles/valve-reused-the-code-for-flickering-lights-in-alyx-22-years-later/
Can be used as component on a Light, or you can call the static methods to animate anything you want.
Implements original integer based light flickers, which are great for harsh flickers, but blends still animate at 10fps, as originally designed.
! May 12, 2025 https://play.max.com
play.max.com##div[data-testid="skip"]
play.max.com##div[data-testid="content_discovery"]
play.max.com##div[data-testid="up_next"]
play.max.com##div[data-testid="ad"]
play.max.com##div[data-testid="pause_ad"]
play.max.com##div[data-testid="ratings_advisories"]
! hover gradient
play.max.com##div[data-testid="playback_controls"] div[data-testid="protection_layer"]
import os
import subprocess
import sys
from pathlib import Path
def human_readable_size(size_bytes):
for unit in ['B', 'KiB', 'MiB', 'GiB', 'TiB']:
if size_bytes < 1024:
return f"{size_bytes:.2f} {unit}"
size_bytes /= 1024