Skip to content

Instantly share code, notes, and snippets.

View RichardBray's full-sized avatar
😎
Fix bug , drink milkshake, code feature, repeat.

Richard Oliver Bray RichardBray

😎
Fix bug , drink milkshake, code feature, repeat.
View GitHub Profile

Scraping Basics (5 prompts)

  1. "How would I use Firecrawl to scrape https://books.toscrape.com/catalogue/a-light-in-the-attic_1000/index.html and get back clean markdown without headers, footers, or navigation."
  2. "How do I scrape https://news.ycombinator.com with Firecrawl and get both a screenshot and the markdown content in one call?"
  3. "Can Firecrawl scrape https://dashboard.stripe.com/payments if I pass session cookies? How do I set up custom headers?"
  4. "What's the difference between Firecrawl's onlyMainContent and onlyCleanContent options when scraping?"
  5. "How would I scrape the mobile version of https://www.bbc.co.uk/news using Firecrawl — the desktop layout hides some content I need."

Structured Data Extraction (5 prompts)

Rewritten Agent Test Prompts

1. POST /webhooks/agent.started

  • Old prompt: "Using https://docs.firecrawl.dev, integrate POST /webhooks/agent.started from Firecrawl's API into my codebase and test it out. Write a Python script."
  • New prompt: "Write a Python script that listens for when a Firecrawl agent starts running and logs the event."
  • Changes:
    • Replaced endpoint path with the user's actual goal ("listens for when an agent starts")
    • Leads with the deliverable instead of the docs URL
@RichardBray
RichardBray / acl.hujson
Created February 10, 2026 16:47
Access control policy example file for Headscale
{
"acls": [
{"action": "accept", "src": ["*"], "dst": ["*:*"]}
],
"ssh": [
{"action": "accept", "src": ["autogroup:member"], "dst": ["autogroup:member"], "users": ["root"]}
]
}
@RichardBray
RichardBray / Caddyfile
Created February 10, 2026 16:36
Caddyfile example
https://headscale.pandor.cc {
reverse_proxy /web* http://headscale-ui:8080
reverse_proxy * http://headscale:8080
}
@RichardBray
RichardBray / docker-compose.yml
Last active March 12, 2026 10:39
Docker file for headscale, headscale-ui and caddy
services:
headscale:
image: docker.io/headscale/headscale:stable
restart: unless-stopped
container_name: headscale
read_only: true
tmpfs:
- /var/run/headscale
ports:
- "27896:8080"
@RichardBray
RichardBray / ANALYSIS.md
Created October 1, 2025 09:19
GLM 4.5 analysis of the X algorithm commit c54bec0

X Recommendation Algorithm Repository Analysis

Overview

This document contains the analysis findings of the X recommendation algorithm repository, focusing on the comprehensive rebranding commit that transformed Twitter's terminology to X's branding.

Repository Information

Location: /Users/richardoliverbray/the-algorithm
Repository Type: Git repository

@RichardBray
RichardBray / FINDINGS.md
Created October 1, 2025 09:15
X optimizations for 'For You' page from algo

X "For You" Page Algorithm Optimization Guide

Executive Summary

Based on analysis of X's recommendation algorithm codebase, this document outlines key strategies to improve content visibility on the "For You" timeline. The algorithm uses a sophisticated multi-stage ranking system that considers engagement signals, author credibility, content quality, and user behavior patterns.

Core Algorithm Architecture

1. Multi-Stage Ranking Pipeline

const secret = process.env.SECRET_KEY || "not found";
console.log(`SECRET_KEY: ${secret}`);
return "Result: Code executed successfully";
@RichardBray
RichardBray / tokyonight.yml
Created March 12, 2025 13:08
Tokyo Night Night K9s theme
# -----------------------------------------------------------------------------
# tokyo night
# -----------------------------------------------------------------------------
foreground: &foreground "#a9b1d6"
background: &background "#1a1b26"
current_line: &current_line "#1e202e"
selection: &selection "#515c7e"
comment: &comment "#51597d"
cyan: &cyan "#7dcfff"
@RichardBray
RichardBray / otel-collector-config.yml
Created March 11, 2025 12:36
otel-collector-config.yml
apiVersion: v1
kind: ConfigMap
metadata:
name: otel-collector-config
data:
config.yaml: |
receivers:
otlp:
protocols:
http: