Skip to content

Instantly share code, notes, and snippets.

@jacobsapps
jacobsapps / difference.swift
Last active August 28, 2026 14:39
Screenshot difference engine with swift-assembly
import AsmMacro
import CoreGraphics
import UIKit
// arm64 C ABI:
// x0 = before RGBA bytes
// x1 = after RGBA bytes
// x2 = pixel count
// x3 = output mask bytes
//
@jacobsapps
jacobsapps / MasterViewController.swift
Created August 25, 2026 07:11
Storyboard segue navigation in Swift 2
import UIKit
final class MasterViewController: UIViewController {
@IBAction func showDetails(sender: UIButton) {
performSegueWithIdentifier("ShowDetails", sender: sender)
}
override func prepareForSegue(
segue: UIStoryboardSegue,
sender: AnyObject?
@jacobsapps
jacobsapps / gist:5f3b7501a169085a3def5bb933a7b98d
Last active September 17, 2026 23:04
Agent session finder
# Agent session finder
A global index for finding and resuming any Claude Code or Codex session without
remembering its folder, checkout, worktree, agent, or session ID.
Give this document to an agent and ask it to install the system.
> **Definition of done**
>
> This system has two equally required halves:
@jacobsapps
jacobsapps / PRIVACY.md
Last active July 12, 2026 12:24
Snap & Summon Privacy Policy

Snap & Summon Privacy Policy

Last updated: July 12, 2026

Snap & Summon is designed to work locally on your device. The developer does not collect, transmit, sell, or share personal data from the app.

Photos and camera

Snap & Summon uses the camera when you choose to photograph something. You may

@jacobsapps
jacobsapps / Haptics.swift
Created June 24, 2026 10:41
Haptics from My top 3 design “Kisses” I like to add to every app
func playAHAP(_ name: String) {
guard
let engine = try? CHHapticEngine(),
let url = Bundle.main.url(forResource: name, withExtension: "ahap")
else { return }
try? engine.start()
let player = try? engine.makePlayer(with: CHHapticPattern(contentsOf: url))
try? player.start(atTime: CHHapticTimeImmediate)
}
@jacobsapps
jacobsapps / Haptics.swift
Created June 24, 2026 10:41
Haptics from My top 3 design “Kisses” I like to add to every app
let event = CHHapticEvent(
eventType: .hapticContinuous,
parameters: [
CHHapticEventParameter(parameterID: .hapticIntensity, value: 1.0),
CHHapticEventParameter(parameterID: .hapticSharpness, value: 1.0),
],
relativeTime: 0,
duration: 60
)
@jacobsapps
jacobsapps / Grain.metal
Created June 24, 2026 10:41
Grain from My top 3 design “Kisses” I like to add to every app
#include <metal_stdlib>
using namespace metal;
[[ stitchable ]] half4 grain(float2 position, half4 color, float amount, float time) {
float noise = fract(sin(dot(floor(position), float2(12.9898, 78.233)) + time) * 43758.5453);
return half4(color.rgb + half3((noise - 0.5) * amount), color.a);
}
@jacobsapps
jacobsapps / ProgressiveBlurView.swift
Created June 24, 2026 10:13
ProgressiveBlurView from My top 3 design “Kisses” I like to add to every app
override func layoutSubviews() {
super.layoutSubviews()
let filter = (NSClassFromString("CAFilter") as! NSObject.Type)
.perform(NSSelectorFromString("filterWithType:"), with: "variableBlur")!
.takeUnretainedValue() as! NSObject
filter.setValue(20, forKey: "inputRadius")
filter.setValue(makeMaskImage(), forKey: "inputMaskImage")
filter.setValue(true, forKey: "inputNormalizeEdges")
@jacobsapps
jacobsapps / ProgressiveBlurView.swift
Created June 24, 2026 10:13
ProgressiveBlurView from My top 3 design “Kisses” I like to add to every app
private final class VariableBlurUIView: UIVisualEffectView {
override func layoutSubviews() {
super.layoutSubviews()
let filter = (NSClassFromString("CAFilter") as! NSObject.Type)
.perform(NSSelectorFromString("filterWithType:"), with: "variableBlur")!
.takeUnretainedValue() as! NSObject
filter.setValue(20, forKey: "inputRadius")
filter.setValue(makeMaskImage(), forKey: "inputMaskImage")
@jacobsapps
jacobsapps / ProgressiveBlurView.swift
Created June 24, 2026 10:13
ProgressiveBlurView from My top 3 design “Kisses” I like to add to every app
struct ProgressiveBlurView: UIViewRepresentable {
func makeUIView(context: Context) -> UIVisualEffectView {
VariableBlurUIView(effect: UIBlurEffect(style: .light))
}
func updateUIView(_ view: UIVisualEffectView, context: Context) {}
}