Skip to content

Instantly share code, notes, and snippets.

View lukebelliveau's full-sized avatar

Luke Belliveau lukebelliveau

View GitHub Profile
@lukebelliveau
lukebelliveau / factorio_programming.md
Last active March 11, 2026 19:02
The Struggle That I Used To Know

The Struggle That I Used To Know

A Love Letter to Factorio & the Craft of Programming

You are an engineer. Your task is to build a complex system of automated machines to achieve the goal state. This goal state is clear, but you are faced with an open-ended path to get there. On the way, you can expect to encounter a complex chain of dependencies and gnarly refactors. Wherever you allow your creation to rot and pollute, bugs will lurk - these bugs will show up to break your system, and your focus. Ultimately, your ability to architect a system designed in such a way that it scales and adapts to new requirements will be your triumph or your downfall.

This is an experience I've had for many years as a software engineer, and more recently during my first play through of my new favorite video game, Factorio. It struck me how much Factorio's game loop felt like programming - or, at least the type of programming I used to do before LLMs came along. I kind of forgot how much I missed

@lukebelliveau
lukebelliveau / CLAUDE_SUBAGENTS_TODO.md
Last active October 10, 2025 07:48
Keeping Claude Code on track during long-running tasks

Keeping Claude On Track With Planning Lists and Subagents

tl;dr: Claude struggles to maintain focus over long sessions and large codebases. To mitigate this, require Claude to maintain a detailed plan in a file and use subagents to complete the plan's tasks one after the other.

Claude Code is great at doing small, self-contained tasks. It starts to show its limitations over the course of longer sessions and larger codebases. As its context fills with information that is no longer relevant, it loses track of the task at hand, its design decisions become less sensible, and it gets worse at following basic instructions as a session progresses.

Often, the biggest struggle with Claude Code is just to help it remember what it's supposed to be working on. As we run out of context space, the agent gets "dumber" and "dumber" until eventually we need to start a new session.

@lukebelliveau
lukebelliveau / claude_notify.sh
Created July 12, 2025 16:28
claude code pushback hook
#!/bin/bash
# Claude Code Notification Hook Setup:
# 1. Make executable: chmod +x claude_notify.sh
# 2. Configure Claude Code hook:
# - Run: claude /hooks
# - Select "Notification" event
# - Add command: /path/to/claude_notify.sh
# 3. Optional: Set environment variables for custom credentials:
# - export PUSHOVER_APP_TOKEN=your_app_token
import Anthropic from "@anthropic-ai/sdk";
import readline from "readline";
const system = "";
const messages = [];
const anthropic = new Anthropic({
apiKey: "get-your-own",
});
{
"messages": [
{
"role": "user",
"content": "i wanna talk about stress tensors. i understand what a tensor is (from machine learning) and i know some basic math but i'm not a physicist\n\n"
},
{
"role": "assistant",
"content": " Sure, I'd be happy to help you understand stress tensors better!\n\nIn physics, a tensor is a mathematical object that describes linear relationships between vectors, scalars, and other tensors. Stress tensors are a specific type of second-order tensor that describe the distribution of forces or stresses within a material or body. They are used extensively in continuum mechanics, engineering, and materials science to analyze the behavior of solid and fluid materials under various loads and deformations.\n\nA stress tensor is a 3x3 matrix that represents the normal and shear stresses acting on an infinitesimal volume element within a material. Each entry in the matrix corresponds to a specific component of the stress vector, which can be resolved
{
"messages": [
{
"role": "user",
"content": "i wanna talk about stress tensors. i understand what a tensor is (from machine learning) and i know some basic math but i'm not a physicist\n\n"
},
{
"role": "assistant",
"content": " Sure, I'd be happy to help you understand stress tensors better!\n\nIn physics, a tensor is a mathematical object that describes linear relationships between vectors, scalars, and other tensors. Stress tensors are a specific type of second-order tensor that describe the distribution of forces or stresses within a material or body. They are used extensively in continuum mechanics, engineering, and materials science to analyze the behavior of solid and fluid materials under various loads and deformations.\n\nA stress tensor is a 3x3 matrix that represents the normal and shear stresses acting on an infinitesimal volume element within a material. Each entry in the matrix corresponds to a specific component of the stress vector, which can be resolved
// generated by GPT-4
class MLP {
constructor(inputSize, hiddenSize, outputSize, learningRate) {
this.inputSize = inputSize;
this.hiddenSize = hiddenSize;
this.outputSize = outputSize;
this.learningRate = learningRate;
this.weightsInputHidden = new Array(inputSize * hiddenSize)
.fill(0)
const ComponentWithStyles = () => (
<div style={style}>
I'm using inline styles.
</div>
)
const style = {
width: '50%',
position: 'fixed',
top: 'calc(50% - 25px)',
@lukebelliveau
lukebelliveau / PRIVACY.md
Created February 16, 2019 19:59
Devil's Dice Game Privacy Policy

Privacy Policy

Devil's Dice Game built the Devil's Dice BETA app as a Free app. This SERVICE is provided by Devil's Dice Game at no cost and is intended for use as is.

This page is used to inform visitors regarding our policies with the collection, use, and disclosure of Personal Information if anyone decided to use our Service.

If you choose to use our Service, then you agree to the collection and use of information in relation to this policy. The Personal Information that we collect is used for providing and improving the Service. We will not use or share your information with anyone except as described in this Privacy Policy.

The terms used in this Privacy Policy have the same meanings as in our Terms and Conditions, which is accessible at Devil's Dice BETA unless otherwise defined in this Privacy Policy.

const Child = (props) => (
/*
Child has no idea where the props.message value came from,
only that it was asked to render itself as a function of 'props'.
*/
<div>props.message</div>
)
class Parent extends React.Component {
constructor(props) {