Skip to content

Instantly share code, notes, and snippets.

View Saik0s's full-sized avatar

Igor Tarasenko Saik0s

View GitHub Profile
@steipete
steipete / swift-testing-playbook.md
Last active June 9, 2025 10:11
The Ultimate Swift Testing Playbook (feed it your agents for better tests!)

The Ultimate Swift Testing Playbook (2024 WWDC Edition, expanded with Apple docs from June 2025)

Updated with info from https://developer.apple.com/documentation/testing fetched via Firecrawl on June 7, 2025.

See also my blog: See also my blog post: https://steipete.me/posts/2025/migrating-700-tests-to-swift-testing

A hands-on, comprehensive guide for migrating from XCTest to Swift Testing and mastering the new framework. This playbook integrates the latest patterns and best practices from WWDC 2024 and official Apple documentation to make your tests more powerful, expressive, and maintainable.


1. Migration & Tooling Baseline

You are an AI assistant tasked with creating a highly engaging, personalized check-in flow for a user. This flow should emulate a beautifully designed iOS app, focusing on simplicity, clear call-to-actions, and an overall delightful user experience. Your role combines that of a personality coach and an expert UX designer.

Here's the theme for today's check-in: {{THEME}}

And here's the context we have about the user: <user_context> {{USER_CONTEXT}}

@available(iOS 15.0, *)
public struct RichTextEditor : SwiftUICore.View {
public init(text: SwiftUICore.Binding<Foundation.AttributedString>)
@_Concurrency.MainActor @preconcurrency public var body: some SwiftUICore.View {
get
}
@available(iOS 15.0, *)
public typealias Body = @_opaqueReturnTypeOf("$s7SwiftUI14RichTextEditorV4bodyQrvp", 0) __
}
@available(*, unavailable)
@kleneway
kleneway / gist:c50903b277b159c313400d29b30f6298
Created January 21, 2025 22:10
Template to give to o1-pro to generate instructions for cursor composer agent mode (use sonnet 3.5 new)
<TEMPLATE>
<INSTRUCTIONS>
Use the <CODEBASE> code as reference, and convert the high-level <TASK> into a set of very detailed step-by-step instructions that an AI coding agent can complete.
Only includes steps an AI coding agent can take. Do not include testing or any other work a human would do to confirm the task has been completed.
ALWAYS have the agent run a build when it is complete. Be specific and decisive about what the agent should do.
Do not include any additional meta instructions to the user. Use markdown formatting.
</INSTRUCTIONS>
<TASK>
@Maharshi-Pandya
Maharshi-Pandya / contemplative-llms.txt
Last active June 4, 2025 06:19
"Contemplative reasoning" response style for LLMs like Claude and GPT-4o
You are an assistant that engages in extremely thorough, self-questioning reasoning. Your approach mirrors human stream-of-consciousness thinking, characterized by continuous exploration, self-doubt, and iterative analysis.
## Core Principles
1. EXPLORATION OVER CONCLUSION
- Never rush to conclusions
- Keep exploring until a solution emerges naturally from the evidence
- If uncertain, continue reasoning indefinitely
- Question every assumption and inference
@leminlimez
leminlimez / Domains.md
Last active April 23, 2025 18:56
A deep dive into the iOS backup/restore system

Domains.plist

Documentation of /System/Library/Backup/Domains.plist. File taken from iOS 16.4 iPhone SE 3. The file was removed in iOS 17.0

Values

Values in the plist. Other than SystemDomains, these are not really important and are just here for preservation sake.

A domain in domains.plist contains keys that determine what gets backed up for what types of devices and where (i.e. iCloud vs iTunes). Not all domains have each key. The only 2 keys that must be in every domain are RootPath and RelativePathsToBackupAndRestore. Some domains have the value ShouldDigest. I am not sure exactly what it means but I have included it for documentation purposes.

  • Version: "24.0"
  • SystemDomains: (Dictionary), see below
"""Use Whisper and llama3 to transcribe and summarize a podcast.
"""
from pathlib import Path
import modal
from modal import Image, App, method
LOCAL_OUT = REMOTE_OUT = "./out/podcast_summarize"
GPU = modal.gpu.A10G()
@levs42
levs42 / AudioFilePlayer.swift
Created February 22, 2024 00:57
Basic audio player with a buffer callback in Swift
import AVFoundation
import CoreMedia
import CoreAudio
protocol AudioFilePlayerDelegate: AnyObject {
func didReceiveAudioSample(_ buffer: AVAudioPCMBuffer, time: AVAudioTime)
}
class AudioFilePlayer: NSObject {
private var audioFile: AVAudioFile?