Skip to content

Instantly share code, notes, and snippets.

@judge2020
judge2020 / cf-headless-login.md
Created July 20, 2026 20:36
Log into the Cloudflare CLI (cf) on a headless/SSH box: why the default browser flow breaks, and a PKCE helper to log in via a browser on your local machine.

Logging into the Cloudflare CLI (cf) on a headless / SSH box

cf auth login (the Cloudflare CLI, not Wrangler or cf the Cloud Foundry tool) assumes it's running on a desktop with a browser. On a remote SSH host with no display, the default flow fails. This explains why, and gives a small helper that logs you in from a headless box using a browser on your local machine.

Verified against cf v0.3.0.


Why the default flow breaks over SSH

@judge2020
judge2020 / grok-build-codebase-breakdown.md
Last active July 16, 2026 02:49
Grok Build (grok CLI) codebase investigation: breakdown by concern with LOC percentages and surprising findings

Grok Build (grok) — full codebase breakdown by concern

An investigation of xAI/SpaceXAI's open-source terminal coding agent ("Grok Build"), published as a single squash commit (b189869 "Publish harness and TUI open-source") synced from their internal monorepo.

Scale: ~1.32M lines of first-party Rust across 77 crates, plus ~26K lines of vendored third-party Rust. About 45% of first-party Rust is test code once inline #[cfg(test)] modules are counted (see the repo-composition page in this gist; dedicated test files alone are ~16%). The root Cargo.toml is generated by monorepo tooling and marked read-only.


LOC by concern

@judge2020
judge2020 / _README.md
Last active March 29, 2025 13:21
Trim transparency from bounds of a gif

Trim transparency from bounds of a gif

Sometimes you have a gif that has a transparent pixel border. This is inconvenient when you don't want this for chat-app emojis or stickers.

Courtest of chatgpt here's a script that takes in a gif via python input and outputs the trimmed gif.

prerequisites

  • ffmpeg
  • gifski (no video mode needed)
@judge2020
judge2020 / TwitterFollowingCSV.js
Last active December 30, 2024 01:48 — forked from roshanmirajkar/TwitterFollowingCSV.js
Twitter Following List Exporter
/*
Collect and export a list of Twitter usernames you're following, along with follow-back status, to a CSV file every 80 seconds. Done client-side using Javascript running in the Console window of the web browser.
Instructions:
1) Modify the 'LANGUAGE' variable to match your Twitter interface language.
2) Customize 'SKIP_USERS' with usernames you do not wish to include in the CSV.
3) 'PRINT_FOLLOW_INFORMATION' determines whether follow-back status is included.
4) 'SKIP_FOLLOWERS' and 'SKIP_NON_FOLLOWERS' settings filter out respective user groups.
5) 'MS_PER_CYCLE' controls the frequency of data collection cycles.
6) Load the Twitter page showing users you're following, open the console (F12), paste this code, and run it.
@judge2020
judge2020 / calculator.js
Last active July 9, 2024 02:17
Tesla Calculator code
/* eslint-disable camelcase */
import React, { useState } from "react";
import {
FormInputRange,
FormInputSelect,
FormItem,
FormLabelRange,
} from "@tesla/design-system-react";
import { Form, Input } from "@tesla/informed-tds";
import { arrayOf, func, number, shape, string } from "prop-types";
@judge2020
judge2020 / plot_discord_predictions.py
Created May 18, 2024 04:05 — forked from rebane2001/plot_discord_predictions.py
Simple script to plot your Discord machine-learning predicted age and gender from the data dump.
import glob
import json
from datetime import datetime
from matplotlib import pyplot
age_ts = []
age_keys = ["prob_13_17", "prob_18_24", "prob_25_34", "prob_35_over"]
age_lists = {k:[] for k in age_keys}
gen_ts = []
@judge2020
judge2020 / fixit.py
Last active December 9, 2023 05:45
Replace x.com/twitter.com with vxtwitter.com in clipboard
# python -m pip install pyperclip
# credit gpt4
import pyperclip
import time
from urllib.parse import urlparse, urlunparse
# Function to check if the content in the clipboard is a URL
def is_url(content):
try:
result = urlparse(content)
@judge2020
judge2020 / readme.md
Last active December 5, 2023 15:59
Fix MacOS Universal Control not working
@judge2020
judge2020 / README.md
Last active April 4, 2024 08:49
Initialize Discord bot in Python 3
  1. python3 -m pip install discord.py
  2. copy the script into a file (e.g. initialize.py)
  3. run python3 initialize.py
  4. quit once you see "We have logged in as <user#1234>"
@judge2020
judge2020 / README.md
Last active August 8, 2026 10:54
Download TikTok Favorites

Setup

  1. Sign into https://tiktok.com and go to your profile
  2. Click favorites or likes
  3. scroll down till all your videos load
  4. paste the script in console and run it
  5. Script will download the file containing newline-delimited links
  6. download via yt-dlp like so: