Skip to content

Instantly share code, notes, and snippets.

View johnmpost's full-sized avatar

John Post johnmpost

View GitHub Profile
@johnmpost
johnmpost / hledger-static-site.md
Last active July 11, 2025 04:41
static site hledger reports
  • i use a bash run style script in my hledger journal repo, so that's part of why it is the way it is (https://james-forbes.com/posts/alternative-to-npm-scripts). you don't have to do that for this to work
  • basically, the idea is that since the canonical state of my journal is in git anyway, and i only need read access, not write, then i don't need a fancy server to see my hledger reports. i can just generate static files based on the latest push to main
  • these can be whatever you want, even just text output, but hledger's latest html output format does a lot of heavy lifting
  • the bash script has a build() function, which calls a bunch of functions to generate files and tweak them for use as a static website. you can look through the bash code for the details but at a high level:
  • i generate the reports i want and output them
  • i generate a register view of each account so i can dig down to individual txns if i want to
  • i generate an index page
@johnmpost
johnmpost / library.ts
Created June 9, 2024 22:49
client-server api architecture using @effect/schema and integrating with @tanstack/react-query
import { pipe, Schema, Ef, A, O, flow } from "./toolbox";
import { CannotConnectToHost } from "./errors";
import {
useMutation,
UseMutationOptions,
useQuery,
UseQueryOptions,
QueryKey,
} from "@tanstack/react-query";
@johnmpost
johnmpost / $portfolio.md
Last active May 12, 2023 21:55
Insight - Individual Portfolio

John Post Individual Portfolio

For each selection, I have pulled out code snippets. The full files that these snippets are from are provided below. All the code in the snippets is code that I claim, whether I wrote it myself or collaborated with someone else.

Selection 1: The Result Module

export type Result<TSuccess> =
  | {
      kind: "success";