This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| local MethodBakeMixin = {} | |
| function MethodBakeMixin:bakeMethods() | |
| local currentClass = self.class | |
| -- Walk up until there is no longer a superclass (the root class) | |
| while currentClass do | |
| for key, value in pairs(currentClass) do | |
| if type(value) == "function" and self[key] == nil then | |
| self[key] = value | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # /// script | |
| # dependencies = [ | |
| # "scenedetect[opencv]", | |
| # ] | |
| # /// | |
| """ | |
| LoopDetector: A utility to detect looping animations within specific scene segments | |
| and process them into clips or GIFs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| # ========================================== | |
| # Configuration & Helpers | |
| # ========================================== | |
| VIDEO_IN="$1" | |
| AUDIO_SRC="${2:-${VIDEO_IN%.*}.mp4}" | |
| TARGET_MB="${3:-20}" | |
| # Check dependencies |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- formatter.yue | |
| import global | |
| {:modf, :abs, :floor, :ceil, :log10, :pow} = math | |
| {:insert, :concat} = table | |
| {:format, :gsub, :sub} = string | |
| -- Constants | |
| DOT_NOTATION = "." | |
| COMMA_NOTATION = "," | |
| MINUS_SIGN = "-" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| -- Register the GZIP loader for .lua.gz files | |
| local function load_gzip_lua(module_name) | |
| -- Convert "a.b.c" to "a/b/c.lua.gz" | |
| local path = module_name:gsub("%.", "/") .. ".lua.gz" | |
| if not love.filesystem.getInfo(path) then | |
| return "\n\tno file '" .. path .. "' (gzip loader)" | |
| end | |
| local data, read_err = love.filesystem.read("data", path) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| # /// script | |
| # dependencies = [ | |
| # "scenedetect[opencv]", | |
| # ] | |
| # /// | |
| """ | |
| SceneCutter: A wrapper utility to detect and extract video scenes from MP4, MKV, and WebM. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>Lite Loop (Dufs Auto-List)</title> | |
| <style> | |
| * { box-sizing: border-box; } | |
| body, html { | |
| margin: 0; padding: 0; height: 100%; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE HTML> | |
| <html> | |
| <!-- | |
| ------------===--------===---====-----::::..:............................................. | |
| ---------====-----:-========--==------:::....................:............:::::::::::::::: | |
| --------------------=========--=------::::................................:::::::::::::::: | |
| -----------------=-===-==-----=+=-----::::..........................:::::::............... | |
| ----------==---==--------:::--=++=----:::.........................::--===-:............::. | |
| ==---=======--===------:::::--=+++=--:::.:......................::-=++++**=:.............. | |
| ========--------::::::::::::--=++++=-:::.......................:-====++****-:............. |
Normalizing User-Agent (UA) strings is a smart move. Raw UA strings are messy, inconsistent, and can be easily spoofed, but they provide a vital "fingerprint" layer when combined with IP and Session IDs.
For a high-traffic site like a video host, storing raw strings leads to database bloat and slow queries. Here is how to normalize them effectively for bot detection and rate limiting.
Don't just store one version of the UA. I recommend breaking it down into three distinct database columns to balance storage efficiency with query flexibility.
NewerOlder