Skip to content

Instantly share code, notes, and snippets.

@the-code-rider
the-code-rider / net-hud.js
Created January 6, 2026 10:38
display network request as a heads up display
(() => {
// --- Guard (so you can re-run safely) ---
if (window.__NET_HUD__) {
window.__NET_HUD__.destroy();
console.log("[net-hud] removed existing HUD");
}
// --- Config ---
const CFG = {
maxItems: 200,
@the-code-rider
the-code-rider / show-keystrokes.js
Created December 28, 2025 12:04
displays keystroke in browser, good for recording product demos
(() => {
// Remove existing instance
const existing = document.getElementById('__keystroke_hud__');
if (existing) existing.remove();
// HUD container
const hud = document.createElement('div');
hud.id = '__keystroke_hud__';
hud.style.cssText = `
position: fixed;
@the-code-rider
the-code-rider / hf-datastudio.md
Created December 22, 2025 11:40
sample prompts from hugging face data studio

title generation

{
    "messages": [
        {
            "role": "system",
            "content": "You are an assistant who generates concise titles for SQL written for Hugging Face Datasets."
        },
        {
            "role": "user",
(() => {
// 1) Find the biggest table on the page (handles cases with multiple tables)
const tables = [...document.querySelectorAll("table")];
if (!tables.length) throw new Error("No <table> elements found.");
const table = tables
.map(t => ({ t, rows: t.querySelectorAll("tbody tr").length }))
.sort((a, b) => b.rows - a.rows)[0].t;
// 2) Extract header
@the-code-rider
the-code-rider / goodreads-list-scrape.py
Created December 8, 2025 07:55
scrape books name and cover from goodreads profile
import time
import json
import sys
import requests
from bs4 import BeautifulSoup
GOODREADS_SHELF_URL = "https://www.goodreads.com/review/list/<<add-your-own-here>>"
SHELF_NAME = "read"
MAX_PAGES = 20
REQUEST_DELAY = 1.0
@the-code-rider
the-code-rider / cartesia-tts.py
Created November 2, 2025 13:55
cartesia tts script
import os
import requests
from dotenv import load_dotenv
import numpy as np
import soundfile as sf
# Load environment variables from .env file
load_dotenv()
# Base URL for Cartesia API