Skip to content

Instantly share code, notes, and snippets.

View lukebarton's full-sized avatar

Luke Barton lukebarton

View GitHub Profile
@lukebarton
lukebarton / README.md
Last active November 18, 2026 09:02
tree-session: a Claude Code skill that keeps a live work tree of a session on claude.ai

tree-session: a Claude Code skill for a live work tree

tree-session keeps a live "work tree" page on claude.ai while you work with Claude Code. The tree shows every piece of work as one line: goals, issues, requests, PRs, steps, snags, asks to other people, and decisions. Claude updates it as things happen. Decisions that need you appear at the top of the page, and you answer them with a click.

Files

  • SKILL.md: the instructions Claude follows.
  • node-rules.md: the fields and shape of each node in the tree.
  • page.html: the page Claude publishes. It reads the tree from the artifact's database.
@lukebarton
lukebarton / index.test.ts
Last active November 24, 2025 20:34
Rate Limiter Design
import { match } from "assert";
import { test, expect } from "vitest";
const STATUS_REJECTED = 429;
const STATUS_ACCEPTED = 200;
type HttpRequest = { id: string; path: string; user_id: string };
type HttpResponse = { request_id: string; status: number };
interface RequestHandler {
@lukebarton
lukebarton / Autotemplate
Last active November 9, 2022 10:41
Quick snip of some templates for Palaeocitharae on the Obsidian Discord
<%*
if ((new RegExp(/^\d{4}$/)).test(tp.file.title)) {
await tp.file.move(tp.date.now("[LifeOS]/YYYY/YYYY", 0, tp.file.title, "YYYY"));
tR += await tp.file.include("[[Year Note Template]]");
}
if ((new RegExp(/^\d{4}-Q\d$/)).test(tp.file.title)) {
await tp.file.move(tp.date.now("[LifeOS]/YYYY/YYYY-[Q]Q", 0, tp.file.title, "YYYY-[Q]Q"));
tR += await tp.file.include("[[Quarter Note Template]]");
}
if ((new RegExp(/^\d{4}-W\d{2}$/)).test(tp.file.title)) {
@lukebarton
lukebarton / lifebit.js
Created March 20, 2018 17:47
If I were to make improvements, I'd sort out the interface and return values around the resolve and getConflicts functions - they could probably use new names too.
module.exports = {
makeRelationshipSet: () => ({
required: {},
conflicting: {}
}),
dependsOn: (package, requiredDependency, ruleSet) => {
initPackage(package, ruleSet);
initPackage(requiredDependency, ruleSet);
ruleSet.required[package].push(requiredDependency);
@lukebarton
lukebarton / lifebit.js
Created March 20, 2018 17:46
If I were to make improvements, I'd sort out the interface and return values around the resolve and getConflicts functions - they could probably use new names too.
module.exports = {
makeRelationshipSet: () => ({
required: {},
conflicting: {}
}),
dependsOn: (package, requiredDependency, ruleSet) => {
initPackage(package, ruleSet);
initPackage(requiredDependency, ruleSet);
ruleSet.required[package].push(requiredDependency);
'use strict'
/**
* I'm using node 5.10.1 --harmony_default_parameters reporting v8 '4.6.85.31'
*
* [Bug] Default Parameters referring to class names do not work with Fat Arrow functions
* So I figured, maybe it's just a difference between Fat Arrow Functions and Full Functions,
* but then I realised that by declaring a Full Function referencing the class,
* it caused the Fat Arrow Function to execute fine. This tells me it's a bonafide bug.
*/
<?php
// Don't touch these
$elementLevel = array(
0 => 'zero',
1 => 'one',
2 => 'two',
3 => 'three',
4 => 'four',
5 => 'five',
6 => 'six',
@lukebarton
lukebarton / example.js
Created January 24, 2011 22:32
Underscore Example
_.map([1, 2, 3], function(n){ return n * 2; });
_([1, 2, 3]).map(function(n){ return n * 2; });