Skip to content

Instantly share code, notes, and snippets.

View dschinkel's full-sized avatar
💻

Dave Schinkel dschinkel

💻
View GitHub Profile
@dschinkel
dschinkel / put-a-dev-secret.sh
Created November 9, 2026 06:19
Keep dev keys in Google Secret Manager instead of .env: put-a-dev-secret.sh stores a key at a hidden prompt; the-studios-secrets.cjs hands them to your dev server as it starts
#!/usr/bin/env bash
# How to move a key out of .env into Secret Manager (run each step in your own terminal, never through an
# AI assistant or a `!` command in one: its output lands in the transcript, and the hidden prompt won't work):
# 1. Sign in to Google Cloud once: gcloud auth login
# 2. Make a NEW key at its provider (links below). Never store a key that has already been in a session's
# transcript: replace it first.
# 3. Store it: scripts/put-a-dev-secret.sh GEMINI_API_KEY and paste the value at the hidden prompt.
# It answers "kept GEMINI_API_KEY as dev-gemini-api-key in maker-studio-app". Running it again adds a
# new version; the latest one is used.
# 4. Keys that come in pairs need both halves stored: ETSY_KEYSTRING + ETSY_SHARED_SECRET,
@dschinkel
dschinkel / README.md
Last active October 17, 2026 08:14
Real CPU % in the Claude Code status line (macOS)

Real CPU % in the Claude Code status line (macOS)

Status line showing CPU, processes and Claude, Codex and AGY sessions

Just ask Claude to add this to your statusline, give claude https://gist.github.com/dschinkel/c8b22c226c62da9b8aa33f5bf97d2e9e

Shows your Mac's real CPU utilization in the Claude Code status line, e.g. CPU 88% · load: 27.9 tasks | processes: 420 (CLI: 42 · other: 378) | Claude: 3 sessions + 2 subagents | Codex: 1 session | AGY: 1 session, refreshed every 2 seconds.

  • cpu-util.py reads the CPU tick counters (host_statistics) and compares them with the previous sample saved in ~/.claude/.cpu-ticks, so the number is the busy share of the last few seconds — not the load average. First run (or a stale sample) takes a quick 200 ms two-sample read. Any error prints nothing.
  • statusline-cpu-segment.sh is the snippet to paste into your status-line script. Green under 60
@dschinkel
dschinkel / GITHUB-PROFILE-HANDOFF.md
Last active October 7, 2026 06:25
LLM handoff: install a custom GitHub profile header with GitHub CLI setup

Handoff: add a custom GitHub profile header

Let your LLM do the magic: Share this gist link with a friend, or give it directly to your LLM: https://gist.github.com/dschinkel/16ce250f477c24b1d5dee1b9ce85ea13. Include your header script or design, and your LLM will handle the setup and publishing, guiding you through GitHub sign-in only if needed. No extra prompt to copy.

Instructions for the LLM receiving this handoff: carry out the setup below. The user does not need to copy another prompt or perform the repository setup themselves.

Add a personalized header image at the top of the user's GitHub profile README, like the header on Dave Schinkel's profile.

Get the header input

@dschinkel
dschinkel / ConvertOneNote2MarkDown-options.csv
Created November 20, 2023 08:40
ConvertOneNote2MarkDown options I selected
option text selected option
Dry Run Enter (keep default)
Folder Path Enter (keep default) - this will export it to c:\temp\notes
Specify a notebook to convert Enter (keep default)
Create a new word .docx Enter (keep default)
Discard .docx after conversion 2 - keep the .docx
Use name .docx fiels using page ID 2 - use hierarchy
Use prefix vs subfolders Enter (keep default)
Markdown file length 255
Store media in single or multiple folders 2 - separate for each folder in hierarchy
@dschinkel
dschinkel / query_for_a_program.js
Created September 22, 2022 23:01
Graph Query Example: Querying the Graph for Program Data
{
programs(where: {
id: "0xceb11bb2725f0ee33f49b5052b3276c02f751c16" // program contract id
}) {
id
metaPtr {
protocol
pointer // ipfs pointer to document which holds more data about a specific program
}
}
@dschinkel
dschinkel / Set.java
Created June 21, 2022 05:39
TDD a Java Set - Attempt 5
package set;
import java.util.Objects;
public class Set {
private int size;
private final int DEFAULT_SIZE = 10;
private String[] elements = new String[DEFAULT_SIZE];
@dschinkel
dschinkel / Set.java
Last active June 21, 2022 01:02
TDD a Java Set - Attempt 4
package set;
import java.util.Objects;
public class Set {
private String[] elements = new String[0];
private int next;
public boolean isEmpty() {
return next == 0;
@dschinkel
dschinkel / list.featured.crafters.spec.tsx
Last active April 25, 2022 17:45
Example Integration Test using isolate-react library
@dschinkel
dschinkel / create-and-insert-countries.sql
Last active April 24, 2022 05:39
Postgres Dialect | dr5hn / countries-states-cities-database
CREATE TABLE countries (
id integer NOT NULL,
name varchar(100) NOT NULL,
iso3 char(3) DEFAULT NULL,
numeric_code char(3) DEFAULT NULL,
iso2 char(2) DEFAULT NULL,
phonecode varchar(255) DEFAULT NULL,
capital varchar(255) DEFAULT NULL,
currency varchar(255) DEFAULT NULL,
currency_name varchar(255) DEFAULT NULL,
@dschinkel
dschinkel / CompanyDetailNew.js
Last active February 24, 2021 03:36
Assert runs before hook done updating state
import React, { useEffect, useState } from 'react';
import { CompanyNew } from '../../../Interfaces/Interfaces';
import Main from '../Main';
import MainLayout from '../MainLayout';
interface CompanyDetailNewProps {
fetchCompanyNew: (apiFindCompanyNew: any, companyName: string) => Promise<CompanyNew>,
apiFindCompanyNew: (companyName: string) => Promise<CompanyNew>,
companyName: string
}