| 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <title>RSA — Multiplicative Homomorphism</title> | |
| <link href="https://fonts.googleapis.com/css2?family=Archivo+Black&family=Work+Sans:wght@400;600&family=Space+Mono&display=swap" rel="stylesheet"> | |
| <style> | |
| *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (() => { | |
| 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"]')]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ## ----setup---- | |
| library(polynom) | |
| library(HomomorphicEncryption) | |
| ## ----seed----- | |
| set.seed(123) | |
| ## ----params----- | |
| M <- 8 | |
| N <- M / 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| from numpy.polynomial import Polynomial | |
| # Set the parameters | |
| M = 8 | |
| N = M // 2 | |
| scale = 64 | |
| xi = np.exp(2 * np.pi * 1j / M) | |
| def vandermonde(xi: np.complex128, M: int) -> np.array: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import Foundation | |
| import AVFoundation | |
| import Vision | |
| import CoreImage | |
| class CameraCapture: NSObject, AVCaptureVideoDataOutputSampleBufferDelegate { | |
| var foundQR: String? | |
| let qrQueue = DispatchQueue(label: "qrqueue") | |
| func captureOutput(_ output: AVCaptureOutput, didOutput sampleBuffer: CMSampleBuffer, from connection: AVCaptureConnection) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 { |
NewerOlder