Skip to content

Instantly share code, notes, and snippets.

View antonmartinsson's full-sized avatar

Anton Martinsson antonmartinsson

View GitHub Profile
@arianvp
arianvp / SSH_MACOS_SECURE_ENCLAVES.md
Last active March 13, 2026 11:29
Native Secure Enclaved backed ssh keys on MacOS

Native Secure Enclave backed ssh keys on MacOS

It turns out that MacOS Tahoe can generate and use secure-enclave backed SSH keys! This replaces projects like https://github.com/maxgoedjen/secretive

There is a shared library /usr/lib/ssh-keychain.dylib that traditionally has been used to add smartcard support to ssh by implementing PKCS11Provider interface. However since recently it also implements SecurityKeyProivder which supports loading keys directly from the secure enclave! SecurityKeyProvider is what is normally used to talk to FIDO2 devices (e.g. libfido2 can be used to talk to your Yubikey). However you can now use it to talk to your Secure Enclave instead!

@yspreen
yspreen / ContentView.swift
Last active June 2, 2025 11:10
Sticky Section Header
/**
* ContentView.swift
* StickyTest
*
* Created by Nick Spreen (spreen.co) on 5/28/25.
*
*/
import SwiftUI
@Matt54
Matt54 / BlobView.Swift
Last active May 4, 2024 17:33
A fluid-like animating SwiftUI View
import SwiftUI
struct BlobView: View {
@State private var mainPosition: CGPoint = .zero
@State private var positions: [CGPoint] = []
private let blurRadius = 20.0
private let alphaThreshold = 0.875
private let ballCount = 20
@ramzesenok
ramzesenok / CoreDataViewModelArchitecture.swift
Last active May 12, 2022 06:26
My attempt to build a reusable ViewModel that uses CoreData as its persistence store
import Combine
import SwiftUI
import CoreData
class CoreDataViewModel: NSObject, ObservableObject, NSFetchedResultsControllerDelegate {
let container: NSPersistentContainer
private var controllerUpdates = [NSObject: CurrentValueSubject<[NSFetchRequestResult], Never>]()
init(container: NSPersistentContainer) {
self.container = container