Skip to content

Instantly share code, notes, and snippets.

View StewartLynch's full-sized avatar

Stewart Lynch StewartLynch

View GitHub Profile
@StewartLynch
StewartLynch / GiftFormView.swift
Last active February 14, 2026 05:39
Gift Form View for Gift Registry SQLiteData series
import SwiftUI
import SQLiteData
@MainActor
@Observable
class GiftFormMModel {
var name = ""
var price: Double?
var isPurchased = false
@StewartLynch
StewartLynch / GiftListSection.txt
Created February 12, 2026 22:19
Gift List Section for Gift Registry
Section {
List {
ForEach(model.gifts) { gift in
HStack {
Button {
// purchaseButtonTapped
} label: {
Image(systemName: gift.isPurchased ? "checkmark.circle.fill" : "circle")
.foregroundStyle(gift.isPurchased ? .green : .secondary)
@StewartLynch
StewartLynch / GiftSeed.txt
Last active February 12, 2026 21:22
Seed Items for Gifts Registry Gifts
// Gifts for Mom (3 gifts)
Gift(id: UUID(0), name: "Gardening Tool Set", price: 49.99, personID: UUID(0))
Gift(id: UUID(1), name: "Cookbook Collection", price: 35.00, isPurchased: true, personID: UUID(0))
Gift(id: UUID(2), name: "Herb Garden Kit", price: 24.99, personID: UUID(0))
// Gifts for Dad (2 gifts)
Gift(id: UUID(3), name: "Golf Club Set", price: 299.99, personID: UUID(1))
Gift(id: UUID(4), name: "Mystery Novel Bundle", price: 45.00, isPurchased: true, personID: UUID(1))
// Gifts for Sarah (4 gifts)
@StewartLynch
StewartLynch / FinanceTrackerPrompt.md
Created February 10, 2026 16:40
Personal Finance Tracker Prompt

Create a SwiftUI Personal Finance Tracker app using SwiftData with the following features:

  1. Data Models:

    • Category: name, color, monthly budget amount, icon (SF Symbol name)
    • Transaction: amount, date, note, relationship to Category
    • Use SwiftData for persistence with proper relationships
  2. Main Dashboard:

    • List of categories showing: name, icon, color
  • For each category: amount spent this month vs budget
@StewartLynch
StewartLynch / HabitTrackerPrompt.md
Created February 10, 2026 16:38
Habit Tracker Prompt

Create a SwiftUI Habit Tracker app using SwiftData with the following features:

  1. Data Model:

    • Habit: name, color, creation date, target frequency (daily/weekly)
    • HabitLog: date completed, relationship to Habit
    • Use SwiftData for persistence
  2. Main Features:

    • List view showing all habits with completion status for today
  • Ability to mark habits as complete/incomplete for today
@StewartLynch
StewartLynch / Agents.md
Created February 9, 2026 00:22
Codex Agents file for the ~/Library/Developer/Xcode/CodingAssistant/codex

Global Codex Code Instructions

Project Documentation Requirements

Agents.md (Project Memory)

When starting work on a new Xcode project, if no AGENTS.md exists in the project root, create one with:

  • Project overview and purpose
  • Key architecture decisions
@StewartLynch
StewartLynch / PersonForm.swift
Last active February 8, 2026 19:33
PersonForm Starter View for Video on SQLiteData
import SwiftUI
struct PersonForm: View {
@State private var name = ""
@State private var birthDate: Date?
@State private var notes = ""
private var dateBinding: Binding<Date> {
Binding {
birthDate ?? Date.now
} set: { setDate in
@StewartLynch
StewartLynch / CLAUDE.md
Created February 6, 2026 20:34
Claude.md Instructions for Xcode 26.3

Global Claude Code Instructions

Project Documentation Requirements

CLAUDE.md (Project Memory)

When starting work on a new Xcode project, if no CLAUDE.md exists in the project root, create one with:

  • Project overview and purpose
  • Key architecture decisions
@StewartLynch
StewartLynch / seed.txt
Created February 3, 2026 22:19
SQLiteData Gist for seeding Person table
try db.seed {
Person(id: UUID(0), name: "Mom", notes: "Likes gardening and cooking")
Person(id: UUID(1), name: "Dad", birthDate: formatter.date(from: "1968-11-03"), notes: "Enjoys golf and reading")
Person(id: UUID(2), name: "Sarah", notes: "Sister - loves art supplies")
Person(id: UUID(3), name: "Grandma", birthDate: formatter.date(from: "1942-02-21"), notes: "Knitting and classic movies")
Person(id: UUID(4), name: "Grandpa", notes: "Fishing trips on weekends")
Person(id: UUID(5), name: "Uncle Joe", birthDate: formatter.date(from: "1975-07-08"), notes: "BBQ master")
Person(id: UUID(6), name: "Aunt Lisa", notes: "Yoga and photography")
Person(id: UUID(7), name: "Cousin Mike", birthDate: formatter.date(from: "2001-09-14"), notes: "Video games and sneakers")
Person(id: UUID(8), name: "Emma", birthDate: formatter.date(from: "1992-03-30"), notes: "Co-worker - coffee enthusiast")
@StewartLynch
StewartLynch / DateOffset.swift
Created January 6, 2026 00:02
Date Offset Extension
import Foundation
extension Date {
/// Returns a date that is `offset` days from this date.
/// - Parameter offset: The number of days to add or subtract from `self`.
/// - Returns: A new `Date` `offset` days days before or after `self`.
func offset(_ offset: Int) -> Date {
Calendar.current.date(byAdding: .day, value: offset, to: self)!
}
}