Skip to content

Instantly share code, notes, and snippets.

View coreyward's full-sized avatar

Corey Ward coreyward

View GitHub Profile
@coreyward
coreyward / writing-style.md
Created August 16, 2026 17:17
This is guidance for Claude Opus 5 and Fable 5 that counteracts some of the more grating elements of it's prose.

Writing style

Prose (chat replies, summaries, reports)

  • Write plain subject-verb-object sentences. Avoid compressed rhetorical constructions like "the constraint the diagram glosses" or "waiting for that confirmation is what keeps X honest" — say "the diagram doesn't show X." These read as LLM-ese, not natural technical writing.
  • One idea per sentence. Assume the reader is context-switching and skimming; they should never have to reread a sentence to work out what it claimed.
@coreyward
coreyward / interface-animation--SKILL.md
Created July 15, 2026 20:55
Shorter, more to-the-point AI guidance on animations, extracted and distilled from Emil Kowalski’s animation skills.

name: interface-animation description: Design, implement, review, and refine UI animation and gesture-driven motion. Use for transitions, entrances and exits, interaction feedback, shared-element and layout motion, drag or swipe behavior, springs, performance, reduced-motion behavior, and motion-system audits.

Interface Animation

Use motion to make an interface clearer, more responsive, easier to follow, or more expressive. Animation is subjective: the values and patterns in this skill are practical starting points, not universal standards. Judge the result in the context of the product, interaction frequency, input method, content, platform, and intended character.

@coreyward
coreyward / bz_done_reference.md
Created March 28, 2026 22:39
bz_done file format reference

Backup Action Logs (bz_done_YYYYMMDD_0.dat)

Location: bzdata/bzbackup/bzdatacenter/

Purpose: Complete history of every backup action — file uploads, deletions, expirations, and large-file reassembly. This is the primary source for reconstructing churn and backup activity over time.

Scale: ~570 files spanning March 2020 to March 2026, totaling 15 GB and 45.8 million lines.

MobileCLIP2-S4 Core ML Conversion

This directory contains the pipeline for converting MobileCLIP2-S4 from PyTorch to Core ML for semantic search in Screenshot Manager.

Quick Start

cd embeddings
./setup.sh # Create venv and install deps
@coreyward
coreyward / git-editor.sh
Created April 11, 2025 19:04
Dynamically configure your git editor based on the IDE you invoke it from
#!/bin/zsh
# Instructions:
# 1. Put this file in your user folder (~/git-editor)
# 2. Enable execution by running `chmod +x ~/git-editor`
# 3. Run `git config --global core.editor "~/git-editor"
# 4. Now when you run a git command that launches your interactive editor, it'll use the current IDE
# Function to get the process name by PID
get_process_name() {
@coreyward
coreyward / lazy-component-map-react.jsx
Created February 20, 2023 21:45
Example of using React 18 Lazy to trigger code splitting when using an import map to render a Sanity-based list of components
import React, { Suspense } from "react";
const componentMap = {
sectionOne: React.lazy(() => import("./SectionOne")),
sectionTwo: React.lazy(() => import("./SectionTwo")),
};
const Section = ({ _type, ...sectionProps }) => {
const SectionComponent = componentMap[_type];
@coreyward
coreyward / injectFnComments.js
Created January 20, 2023 21:38
Inject JSDoc comments into generated TypeScript Type definition files
/**
* This script injects JSDoc comments from the JS source files into the type
* definition files. This is necessary because the type definition files
* generated by TypeScript do not include JSDoc comments.
*
* @see https://github.com/microsoft/TypeScript/issues/14619
*
* The strategy is a bit hacky, but straightforward:
*
* 1. Recursively walk the output folder looking for .d.ts files
@coreyward
coreyward / upload-image-to-sanity.js
Created June 30, 2022 15:24
Quick reference code for uploading an image to the Sanity Studio from the browser
const getImageData = async url => {
const response = await global.fetch(url)
const contentType = response.headers.get("Content-Type")
return response.blob().then(imageData => ({ contentType, imageData }))
}
const uploadImage = ({ imageData, contentType }) =>
client.assets.upload("image", imageData, { contentType })
// usage example
@coreyward
coreyward / replaceRefs.js
Created June 28, 2022 14:23
Replace all references - Sanity
// import and configure the client
const oldRef = "abc123"
const newRef = "def456"
client
.fetch(
`*[references($oldRef)][0...250] {
_id,
_rev,
@coreyward
coreyward / _Inline SVGs Gatsby Sanity README.md
Last active June 28, 2022 14:22
Inline SVGs from Sanity in Gatsby

To render the SVG, it's useful to have a wrapper component that allows passing in additional props:

import React from "react"
import { compiler } from "markdown-to-jsx"

const InlineSvg = ({ content, ...props }) => 
  compiler(content, {
    createElement: (type, elProps, children) =>
 React.createElement(type, { ...elProps, ...props }, children),