Skip to content

Instantly share code, notes, and snippets.

View cmj's full-sized avatar
💭
📠

cmj cmj

💭
📠
View GitHub Profile
@cmj
cmj / bashrc_twitter_at_handler.md
Created October 26, 2026 16:25
bash at command scriipt

Enable @username in bash render tweets via kitty-tweet

copy this into ~/.bashrc

command_not_found_handle() {
    if [[ $1 =~ ^@[^[:space:]]+$ ]]; then
        kitty-tweet "$@"
        return $?
 fi
@cmj
cmj / shade
Created October 25, 2026 20:36
window shading/stretching script, bind to a shortcut
#!/bin/bash
# KDE6 unshade hack.
# Stretch stuck unshaded window to 3/4 of the current screen height, preserve width
win=$(xdotool getactivewindow 2>/dev/null) || exit 0
[ -z "$win" ] && exit 0
# Bail if the "active window" is the root window
root=$(xwininfo -root | awk '/Window id:/{print $4}')
[ "$(printf '0x%x' "$win")" = "$root" ] && exit 0
@cmj
cmj / 0-screenshot.md
Created October 25, 2026 09:32
Print tweet with images to kitty term

@cmj
cmj / reddit.py
Last active October 22, 2026 02:01
fix for reddit data after 2026-10-21 new restrictions
#!/usr/bin/env python3
# json dump reddit post/comment data
# requires curl_cffi, reddit account cookie
# ex: reddit.py "https://www.reddit.com/r/kde/comments/.json?limit=25"
# reddit.py "https://www.reddit.com/r/kde/new/.json?limit=15"
import sys
import json
from curl_cffi import requests
@cmj
cmj / down
Created October 14, 2026 08:14
Print top 15 services reported from downdetector.com
#!/usr/bin/env python3
# Print services/sites that are reporting issues via downdetector.com
# - pip install curl_cffi
# ex: Verizon • Spectrum • Google Fiber • Cox • OpenAI • AT&T • T-Mobile • YouTube • Wyyerd Fiber • X (Twitter) • Xfinity by Comcast • Roblox • TDS Telecom• Steam • Google
import sys
from bs4 import BeautifulSoup
from curl_cffi import requests
URL = "https://downdetector.com"
@cmj
cmj / t.md
Created October 9, 2026 09:46
t

@cmj
cmj / fitgirl-ff-slurp
Created October 4, 2026 13:36
slurp all fitgirl urls
#!/bin/bash
# sequential fuckingfast downloader for fitgirl-repacks
# example:
# $ fitgirl-ff-slurp https://fitgirl-repacks.site/sonic-racing-crossworlds-pc/
ff-slurp() {
curl_ff117 -s "$1" |
sed -En 's|.*<title>(.*)</title>|\1|p;s|.*hx-post="(.*)" hx-swap.*|https://fuckingfast.co\1|p' |
xargs |
while read file redir; do
{
"data": {
"tweetResult": {
"result": {
"__typename": "Tweet",
"core": {
"user_results": {
"result": {
"__typename": "User",
"affiliates_highlighted_label": {},
@cmj
cmj / extract_tweets-ssr.py
Last active September 26, 2026 03:50
extract last 5 tweets from a twitter account as guest
#!/usr/bin/env python3
"""
Extract tweet id, timestamp, and text from an X/Twitter profile timeline
using recent SSR as guest. Output as plaintext, json or rss.
Usage:
python3 extract_tweets.py elonmusk
python3 extract_tweets.py cnn
python3 extract_tweets.py nasa --json
python3 extract_tweets.py nasa --rss > nasa.xml
@cmj
cmj / trending-woeids.md
Last active September 29, 2026 05:31
Country WOEIDs that return trending results