Skip to content

Instantly share code, notes, and snippets.

View tgvashworth's full-sized avatar

Tom Ashworth tgvashworth

View GitHub Profile
@tgvashworth
tgvashworth / in-memory-cache-removal-plan.md
Created December 23, 2025 18:14
Analysis: Remove in-memory list cost cache from Gyrinx

Plan: Remove In-Memory List Cost Cache

Background

The codebase has TWO cost caching mechanisms:

  1. Database fields (rating_current, stash_current, dirty) - KEEP - central to facts system
  2. In-memory Django cache (caches["core_list_cache"]) - REMOVE - no longer needed

The in-memory cache is updated by signals on every List/ListFighter/Assignment change. These signals are expensive and redundant now that the facts system uses DB fields.

@tgvashworth
tgvashworth / 2025-12-20-caveat-the-messages-below-were-generated-by-the-u.txt
Created December 22, 2025 16:26
Django 6.0 Tasks with Google Cloud Pub/Sub - Full Design Document
* ▐▛███▜▌ * Claude Code v2.0.75
* ▝▜█████▛▘ * Opus 4.5 · Claude Max
* ▘▘ ▝▝ * ~/code/gyrinx/gyrinx
> /clear
⎿  (no content)
> /feature-dev:feature-dev Event-driven task handling. we have Django 6.0 with
the new tasks framework, and we're in GCP + cloud run. I'd like to suport Google
@tgvashworth
tgvashworth / integration-analysis-recommendations.md
Created December 22, 2025 16:08
Claude Code Integration Analysis for Gyrinx

Claude Code Integration Analysis: Gyrinx

Date: 2025-12-22

Summary

Metric Value
CLAUDE.md files 2 (root + analytics)
.claude/rules/ Not used
@tgvashworth
tgvashworth / machine.js
Created September 16, 2019 14:23
Generated by XState Viz: https://xstate.js.org/viz
const { } = XState;
const { log } = actions;
const generateVoucherStates = {
id: 'generate-voucher',
initial: 'addToCsv',
states: {
addToCsv: {
entry: 'addCsvEntry',
on: {
@tgvashworth
tgvashworth / machine.js
Last active September 16, 2019 14:10
Generated by XState Viz: https://xstate.js.org/viz
const { } = XState;
const { log } = actions;
const generatePaymentStates = {
id: 'generate-payment',
initial: 'generating',
states: {
generating: {
on: {
'': [
@tgvashworth
tgvashworth / machine.js
Last active September 23, 2019 14:46
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@tgvashworth
tgvashworth / machine.js
Last active September 16, 2019 09:50
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@tgvashworth
tgvashworth / index.js
Created April 16, 2016 13:53
requirebin sketch
var _ = require("lodash");
window.$ = window.jQuery = require("jquery");
var flight = require("flightjs");
var withState = require("flight-with-state");
var redux = require("redux");
var createStore = redux.createStore;
var combineReducers = redux.combineReducers;
@tgvashworth
tgvashworth / index.js
Created April 16, 2016 13:21
requirebin sketch
window.$ = window.jQuery = require("jquery");
var flight = require("flightjs");
var withState = require("flight-with-state");
var redux = require("redux");
var createStore = redux.createStore;
function counter(state, action) {
state = state || 0;
switch (action.type) {
@tgvashworth
tgvashworth / index.js
Created March 18, 2016 15:51
requirebin sketch
// require() some stuff from npm (like you were using browserify)
// and then hit Run Code to run it on the right
window.$ = require('jquery');
var component = require('flightjs').component;
var withState = require('flight-with-state');
var ToggleButton = component(withState, function ToggleButton() {
this.attributes({
enabledMessage: 'Enabled',