Skip to content

Instantly share code, notes, and snippets.

View bquast's full-sized avatar
👋

Bastiaan Quast bquast

👋
View GitHub Profile
@bquast
bquast / claude-export-markdown.js
Created April 12, 2026 10:33
Export Claude conversation to markdown
(() => {
const title = document.title.replace(' - Claude', '').trim();
const lines = [`# ${title}\n`];
// Grab every turn in the conversation
const turns = document.querySelectorAll('[data-testid="user-message"], .font-claude-response-body, .standard-markdown');
// Better approach: walk the full message list
// User messages
const userMsgs = [...document.querySelectorAll('[data-testid="user-message"]')];
@bquast
bquast / calmplot.js
Last active April 11, 2026 12:28
calm animation for blog charts live, example in the comments
(function () {
function parseDuration(value) {
var text = String(value || "").trim();
if (text.endsWith("ms")) {
return parseFloat(text.slice(0, -2));
}
if (text.endsWith("s")) {
return parseFloat(text.slice(0, -1)) * 1000;
@bquast
bquast / microgpt.R
Last active April 11, 2026 11:52
bare-bones no-deps GPT algo in R language, Functional Programming (FP)
input_file <- "input.txt"
if (!file.exists(input_file)) {
names_url <- "https://raw.githubusercontent.com/karpathy/makemore/refs/heads/master/names.txt"
download.file(names_url, input_file)
}
lines <- readLines(input_file, warn = FALSE)
docs <- lines[nchar(trimws(lines)) > 0]
set.seed(42)
docs <- sample(docs)
name cloudflare-pages-vanilla-preferences
description Follow Bastiaan's Cloudflare Pages preferences when discussing, advising on, generating code for, or debugging Cloudflare Pages projects (especially vanilla HTML/CSS/JS setups). Use this skill whenever the user mentions Cloudflare Pages, Pages Functions, wrangler, static sites on Pages, vanilla JS, routing, dynamic routes, file structure, or related issues.
version 1.4
author Bastiaan Quast (@baquast)

Core Preferences & Rules – Always Obey These

Project Structure & Files – Static Assets

// ==UserScript==
// @name Grokipedia Search Result Copy URL
// @namespace http://tampermonkey.net/
// @version 1.0
// @description Adds a copy URL button to each search result on the Grokipedia search results page.
// @author Bastiaan Quast
// @match https://grokipedia.com/search*
// @grant GM_setClipboard
// @grant GM_addStyle
// @run-at document-idle
const { Readability } = require('@mozilla/readability');
const jsdom = require('jsdom');
const fs = require('fs');
const path = require('path');
const os = require('os');
const fetch = (...args) => import('node-fetch').then(({default: fetch}) => fetch(...args));
// Helper to download an image and return the local filename
async function downloadImage(imgUrl, folder, idx) {
try {
import numpy as np
from numpy.polynomial import Polynomial
def polynomial_modulo(polynomial, mod):
q, r = divmod(polynomial, mod)
return r
def mod_on_coefficients(polynomial, modulo):
coefs = polynomial.coef
mod_coefs = [c % modulo for c in coefs]
## ----setup----
library(polynom)
library(HEtools)
## ----params----
d = 4
n = 2^d
p = (n/2)-1
t = p
q = 868
// ==UserScript==
// @name Google Docs Side Panel Hide
// @namespace http://tampermonkey.net/
// @version 2024-04-21
// @description Hide the Google Docs Side Panel (Calendar, Keep, Maps, etc.) toggle button for a clean slate.
// @author Bastiaan Quast
// @match https://docs.google.com/document/d/*
// @icon none
// @grant GM_addStyle
// ==/UserScript==
@bquast
bquast / BGV-2.py
Created January 3, 2024 14:05
BGV in Python
import numpy as np
from numpy.polynomial import Polynomial
def polynomial_modulo(polynomial, mod):
"""
Perform polynomial modulo operation using divmod.
"""
q, r = divmod(polynomial, mod)
return r