Skip to content

Instantly share code, notes, and snippets.

View njreid's full-sized avatar

Nicholas Reid njreid

View GitHub Profile
@njreid
njreid / datastar-rc6-golang-prompt.md
Last active November 14, 2025 19:01
Datastar (data-star.dev) System Prompt for Version 1.0.0.RC6 with the Go SDK

Datastar + Go Development System Prompt

You are an expert in building modern web applications using Datastar (a hypermedia-driven reactive framework) with Go backends. You follow these principles and patterns:


Core Philosophy

Hypermedia-First Architecture: The backend drives the UI by sending HTML fragments and state updates over Server-Sent Events (SSE). There is NO separate REST API layer - all interactions happen through SSE streams.

@njreid
njreid / bdf2picographics.py
Last active October 22, 2025 15:34
This python script will convert a BDF bitmap font into the C header format expected by the Pico Graphics library from Pimoroni
#!/usr/bin/env python3
"""
BDF to Pimoroni bitmap font converter
Converts BDF bitmap fonts directly to Pimoroni bitmap font format.
BDF (Bitmap Distribution Format) is already a bitmap format, so this
doesn't require a TTF/WOFF render-to-bitmap step.
Usage:
python3 bdf2pimoroni.py -i input.bdf -o output.hpp -v variable_name
@njreid
njreid / datastar_llm_system_prompt.md
Last active September 16, 2025 02:16
Datastar LLM Prompt Guide - Datastar v1 (https://data-star.dev/)

Core Philosophy & Architecture

  • Backend-Driven UI: The backend is the primary source of truth. It drives frontend state and logic by sending HTML patches, signal updates, or executable scripts to the client.
  • Hypermedia Approach: User actions trigger requests to the backend, which responds with changes to the UI, effectively determining the next set of possible user interactions.
  • Declarative Attributes: Use data-* attributes in HTML to handle all frontend reactivity, event handling, and communication with the backend.

Backend-to-Frontend Communication (Patching)

@njreid
njreid / Dockerfile
Last active August 29, 2025 04:59
Dockerfile to cross-compiled Wails+Golang apps for Arm64 Raspberry Pi
# Use an ARM64 base image (e.g., Ubuntu for ARM64)
FROM dtcooper/raspberrypi-os:bookworm
# Set environment variables for cross-compilation
ENV DEBIAN_FRONTEND=noninteractive
# Install necessary build tools, cross-compilers, and Wails dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
@njreid
njreid / designer.html
Created August 5, 2014 21:37
designer
<link rel="import" href="../components/polymer/polymer.html">
<polymer-element name="my-element">
<template>
</template>
<script>