Skip to content

Instantly share code, notes, and snippets.

View wtsnz's full-sized avatar
🛠️
Working

Will Townsend wtsnz

🛠️
Working
View GitHub Profile
@zachdaniel
zachdaniel / .zshrc
Last active July 13, 2025 17:10
plz - Pipe into and out of claude code.
# get current cmd before executing
preexec() {
export PLZ_CURRENT_COMMAND="$1"
}
# so we can provide it to plz
plz() {
PLZ_FULL_CMD="$PLZ_CURRENT_COMMAND" $HOME/.dotfiles/scripts/plz "$@"
}
@badlogic
badlogic / 01-update-docs.md
Last active December 3, 2025 12:06
Yakety Documentation (Ordered) - LLM-optimized docs with concrete file references

Update Documentation

You will generate LLM-optimized documentation with concrete file references and flexible formatting.

Your Task

Create documentation that allows humans and LLMs to:

  • Understand project purpose - what the project does and why
  • Get architecture overview - how the system is organized
  • Build on all platforms - build instructions with file references
@karlhorky
karlhorky / .cursorrules
Created June 1, 2025 10:23 — forked from boxabirds/.cursorrules
Rock solid: turn Cursor into a rock-solid software engineering companion
# Project Policy
This policy provides a single, authoritative, and machine-readable source of truth for AI coding agents and humans, ensuring that all work is governed by clear, unambiguous rules and workflows. It aims to eliminate ambiguity, reduce supervision needs, and facilitate automation while maintaining accountability and compliance with best practices.
# 1. Introduction
> Rationale: Sets the context, actors, and compliance requirements for the policy, ensuring all participants understand their roles and responsibilities.
## 1.1 Actors
  1. Create a Droplet on e.g. DigitalOcean.
    • Make sure it has at least 1 vCPU and 1 GB of memory.
    • Mine has: 1 vCPU, 1 GB, 35 GB NVMe SSD, Premium Intel CPU, Ubuntu 24.04 LTS for $8/month on Digital Ocean
    • Choose SSH KEY AUTHENTICATION and create a new SSH key.
    • Remember the server's IPv4 address.
  2. Sign up for a Container Registry e.g. on Digital Ocean for $5/mo (the 500MB free plan won't cut it)
    • Remember your username on the registry
  3. Create an API Token at https://cloud.digitalocean.com/account/api/tokens for pushing images to the registry.
    • It needs to have these scopes: registry (4): delete, update, read, create
  4. Install Kamal with gem install kamal
@lukeredpath
lukeredpath / Converting a TCA App to Swift 6.md
Last active November 13, 2025 10:41
Converting a TCA app to Swift 6

I maintain the Community mobile app - a moderately large codebase that is fully modularized using Swift Package Manager and uses The Composable Architecture. I have recently completed the process of getting the project ready for Xcode 16 and Swift 6 and I wanted to outline the approach I took and some of the issues I encountered, especially regarding TCA.

The Approach

There are already [good

import SwiftUI
#warning("TODO: <Connor> Make handles generic views so they are customizable rather than assuming what people want. (Provide defaults)")
#warning("TODO: <Connor> Use my custom @StateBinding property wrapper to allow consumers to optionally pass a binding to the bools for isExpanded, isMoving, isResizing. Then they can react in the parent, or they can not pass a binding and let the view handle the state internally.")
#warning("TODO: <Connor> General cleanup of calculations and code density.")
// MARK: - ViewManipulation
struct ViewManipulation: OptionSet {
@danhalliday
danhalliday / Setting.swift
Last active December 21, 2023 05:37
Sketch of a settings dependency.
import SwiftUI
import Dependencies
import AsyncExtensions
public struct Setting<Value:Sendable>: Sendable {
let id: String
let name: String
let fallback: Value
let load: @Sendable (String) -> Value?
struct OverflowLayout: Layout {
var spacing = CGFloat(10)
func sizeThatFits(proposal: ProposedViewSize, subviews: Subviews, cache: inout ()) -> CGSize {
let containerWidth = proposal.replacingUnspecifiedDimensions().width
let sizes = subviews.map { $0.sizeThatFits(.unspecified) }
return layout(sizes: sizes, containerWidth: containerWidth).size
}
func placeSubviews(in bounds: CGRect, proposal: ProposedViewSize, subviews: Subviews, cache: inout ()) {
@KazaiMazai
KazaiMazai / CollectionView.swift
Last active May 7, 2025 07:35
Better SwiftUI wrapper for UICollectionView
import SwiftUI
extension CollectionView {
typealias UIKitCollectionView = CollectionViewWithDataSource<SectionIdentifierType, ItemIdentifierType>
typealias DataSource = UICollectionViewDiffableDataSource<SectionIdentifierType, ItemIdentifierType>
typealias Snapshot = NSDiffableDataSourceSnapshot<SectionIdentifierType, ItemIdentifierType>
typealias UpdateCompletion = () -> Void
}
struct CollectionView<SectionIdentifierType, ItemIdentifierType>
@IanKeen
IanKeen / Abstraction.swift
Created August 16, 2022 17:41
TCA Scoping Abstraction
// MARK: - TCAView
public protocol TCAView: View where Body == WithViewStore<ScopedState, ScopedAction, Content> {
associatedtype ViewState
associatedtype ViewAction
associatedtype ScopedState
associatedtype ScopedAction
associatedtype Content