Skip to content

Instantly share code, notes, and snippets.

View ahbanavi's full-sized avatar
🎯
Focusing

Amir ahbanavi

🎯
Focusing
View GitHub Profile
@ahbanavi
ahbanavi / README.md
Created November 18, 2026 07:34
GTA VI spoiler mute list for X (Twitter) + one-paste console importer (30 days, from anyone)

GTA VI spoiler mute list for X

31 muted words for X (Twitter) to avoid GTA VI spoilers: game names, spoiler and leak hashtags, places in Leonida, and the named cast. x-mute-import.js adds them all to your account in one paste. By default each word is muted for 30 days, from anyone, in both your Home timeline and notifications.

Import in one paste

  1. On a desktop browser, log in to X and open https://x.com/settings/muted_keywords
  2. Open the DevTools console: F12, or Ctrl+Shift+J on Windows/Linux, Cmd+Option+J on Mac
  3. Paste the whole of x-mute-import.js and press Enter. Chrome may first ask you to type allow pasting.
  4. Leave the tab open until the console prints Done
@ahbanavi
ahbanavi / google-messages-shortcuts.user.js
Created November 12, 2026 11:32
Google Messages: keyboard shortcuts and hover buttons for delete, archive, block & report spam (userscript)
// ==UserScript==
// @name Google Messages: quick delete / archive / block & report
// @namespace https://messages.google.com/
// @version 1.2.1
// @description Keyboard shortcuts for messages.google.com: delete, archive, and block & report spam, with no confirmation prompts.
// @match https://messages.google.com/web/*
// @run-at document-idle
// @grant none
// ==/UserScript==
@ahbanavi
ahbanavi / README.md
Last active November 3, 2026 08:25
Claude FM for Windows: the YouTube live stream as a small mpv radio with a Start menu shortcut and minimize-to-tray

Claude FM for Windows

A Start menu launcher for the Claude FM YouTube live stream. It plays audio only, in a small mpv window that minimizes to the tray.

Unofficial; not affiliated with Anthropic.

Claude FM window

What you get

@ahbanavi
ahbanavi / README.md
Last active October 30, 2026 09:35
Moved to github.com/ahbanavi/openwrt-passwall2-tools (killswitch/): pw-killswitch, a killswitch for passwall2 on OpenWrt
@ahbanavi
ahbanavi / README.md
Last active October 30, 2026 09:35
Moved to github.com/ahbanavi/openwrt-passwall2-tools (patches/): five local patches for passwall2 on OpenWrt
@ahbanavi
ahbanavi / README.md
Last active October 30, 2026 09:34
Moved to github.com/ahbanavi/openwrt-passwall2-tools (failover/): pw-failover, passwall2 node and WAN failover for OpenWrt
@ahbanavi
ahbanavi / README.md
Created October 5, 2026 10:33
trakt-backup: back up a whole Trakt.tv account (incl. hidden/dropped shows, playback) to a ZIP of JSON via the API, from cron. Same files as Trakt's web export. Python stdlib only.

trakt-backup

Back up a whole Trakt.tv account to a ZIP of JSON files through the Trakt API, unattended, from cron or any scheduler. One Python file, standard library only.

What it saves

trakt_backup.py makes the same API calls as Trakt's own web export (Settings ▸ Data ▸ Raw Export) and writes the same file names: one JSON per endpoint, with a -<page> suffix when an endpoint spans several pages. The endpoint list was read from the web app's export code in October

@ahbanavi
ahbanavi / README.md
Created August 7, 2026 14:31
Full voice control of an LG C5 (webOS 25) from Home Assistant + Google Assistant, without LG ThinQ — IR turn-on because Wake-on-LAN can't work, screen-off, app launching, repurposed remote keys

Full voice control of an LG C5 (webOS 25) from Home Assistant + Google Assistant — without LG ThinQ

Everything here runs over the LAN: no LG cloud, no Nabu Casa, no rooting the TV, nothing sideloaded onto it. Home Assistant talks to the set with the built-in webostv integration, and Google only ever sees HA's own fulfillment.

Written up because ThinQ was a dead end for me and most of the individual pieces below are either undocumented, wrong in the obvious place, or only findable by reading the integration source.

Tested on an OLED65C56LA, firmware 33.31.68, HA 2026.7.4.

@ahbanavi
ahbanavi / README.md
Created August 6, 2026 14:17
Jellyfin on LG webOS: every clock off by your UTC offset — webOS's WebAppManager engine resolves Intl's default time zone to Etc/Unknown (= UTC) while Date is correct. Full diagnosis + a self-gating JS fix.

Jellyfin on LG webOS: every clock is off by exactly your UTC offset

TL;DR — webOS's WebAppManager engine resolves the default Intl time zone to Etc/Unknown, which ICU formats as UTC. Date is perfectly correct; only Intl is broken. jellyfin-web renders every clock through Intl, so they all shift together by your UTC offset. Nothing about your TV, server, or container time zone is misconfigured. Fix: pin the zone from JavaScript (webos-intl-timezone-fix.js).


Symptoms

In the Jellyfin app on an LG Smart TV, every rendered time is behind (or ahead) by exactly your UTC offset:

@ahbanavi
ahbanavi / script.js
Created March 17, 2025 06:43
find duplicated name in a web page
const findDuplicateNames = () => {
// Get all form elements excluding radio buttons
const elements = document.querySelectorAll('input:not([type="radio"]), textarea, select');
const nameMap = new Map();
elements.forEach(element => {
const name = element.getAttribute('name');
if (name) {
if (!nameMap.has(name)) {