Skip to content

Instantly share code, notes, and snippets.

View schpet's full-sized avatar

Peter Schilling schpet

View GitHub Profile
@schpet
schpet / claude.ts
Created February 10, 2026 16:55
working script to copy claude credentials via `claude setup-token` to new vms
/**
* Copy Claude Code credentials from the repoman server to the VM.
* This allows the VM to use Claude Code without manual login.
* Uses CLAUDE_CODE_OAUTH_TOKEN from server environment to set up OAuth authentication.
* Silently skips if OAuth token is not available.
*/
async function copyClaudeCredentials(sshCommand: string): Promise<void> {
const sshTarget = extractSshTarget(sshCommand);
// Get OAuth token from environment
/**
* Copy Claude Code credentials from the repoman server to the VM.
* This allows the VM to use Claude Code without manual login.
* Uses CLAUDE_CODE_OAUTH_TOKEN from server environment to set up OAuth authentication.
* Silently skips if OAuth token is not available.
*/
async function copyClaudeCredentials(sshCommand: string): Promise<void> {
const sshTarget = extractSshTarget(sshCommand);
// Get OAuth token from environment
@schpet
schpet / prefab-feb2-database.md
Created February 4, 2026 19:30
Prefab Feb-2 database + guestbook notes

prefab-feb-2 Database Navigator + Guestbook GraphQL Issue

Last updated: 2026-02-04

Overview

  • Builder/target stack running on prefab-feb-2 host (current box, public IP 134.209.44.21).
  • Database Navigator tab in build session originally failed because app/services/database namespace wasn’t autoloaded. We fixed this locally on prefab-feb-2 by:
    • Adding app/services to autoload_paths and eager_load_paths in config/application.rb.
    • Creating app/services/database.rb and updating app/services/database/error_classes.rb to satisfy Zeitwerk naming.
  • Running docker-compose run --rm builder-web bundle exec rails zeitwerk:check (passed) and restarting builder containers.
@schpet
schpet / pi-setup-guide.md
Created February 4, 2026 18:00
Pi Coding Agent Setup Guide

Pi Coding Agent Setup Guide

1. Install the Agent

npm install -g @mariozechner/pi-coding-agent

2. Launching Pi

# Interactive REPL
@schpet
schpet / allspark-model-usage-analysis.md
Created January 15, 2026 21:42
ALL-43: AllSpark Builder AI Model Usage Analysis

AllSpark Builder - AI Model Usage Analysis

Issue: ALL-43 - Allow user to choose model (opus or sonnet) in the builder UI

Date: 2026-01-15


Overview

From 263700b42d405f4c5330406511f0720f79f6f353 Mon Sep 17 00:00:00 2001
From: Peter Schilling <peter@tanookilabs.com>
Date: Thu, 10 Aug 2023 16:45:56 -0700
Subject: [PATCH] React
---
.../{application.ts => application.tsx} | 14 ++++++++++++++
app/views/layouts/application.html.erb | 2 +-
package.json | 4 ++++
3 files changed, 19 insertions(+), 1 deletion(-)
@schpet
schpet / FancyFileInput.tsx
Last active December 16, 2021 00:39
React component for adding and removing files from Active Record's `has_many_attached`. assumes imgix is used.
import { DirectUpload } from "@rails/activestorage"
import React, { useRef, useState } from "react"
import Imgix, { ImgixProvider } from "react-imgix"
import { withBasics } from "./withBasics"
export interface Props {
name: string
directUploadUrl: string
attachments: Attachment[]
imgixSource: string
@schpet
schpet / machine.js
Created July 28, 2021 17:36
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@schpet
schpet / machine.js
Created July 27, 2021 22:21
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@schpet
schpet / machine.js
Created May 6, 2021 01:49
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions