This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // By Claude Opus 5 - workaround for DragGesture(minimumDistance: 0) not behaving correctly in iOS 27.0 | |
| #if !os(macOS) | |
| import SwiftUI | |
| import UIKit | |
| /** | |
| * A gesture that begins when a touch is down and ends when it lifts | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # fatal: 'branch' is already used by worktree /path/to/worktree | |
| # grrrrrr | |
| # cdgit branch | |
| # pwd | |
| # /path/to/worktree | |
| cdgit() { | |
| local branch="${1:-main}" | |
| cd "$(git worktree list | awk -v branch="[$branch]" '$NF == branch {print $1}')" | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // FileImporterSimultaneous.swift | |
| // Learn | |
| // | |
| // Created by Juan Arzola on 1/31/26. | |
| // Copyright © 2026 Juan Arzola. All rights reserved. | |
| // | |
| import SwiftUI | |
| import UniformTypeIdentifiers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import SwiftData | |
| import CoreSpotlight | |
| import FetchDescriptorObserver | |
| import OSLog | |
| import AppIntents | |
| private let logger = Logger.spotlight | |
| // Initialize from a SwiftData PersistentModel | |
| protocol FromPersistentModel { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| extension FetchDescriptor { | |
| public static func model<Model: PersistentModel & UUIDString>( | |
| withUUIDString uuidString: String? | |
| ) -> FetchDescriptor<Model> { | |
| guard let uuidString else { return .init(predicate: .false) } | |
| let pred = #Predicate<Model> { $0.uuid == uuidString } | |
| var desc = FetchDescriptor<Model>(predicate: pred) | |
| desc.fetchLimit = 1 | |
| return desc | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| TARGET="user@host.local"; APP="/path/to/DerivedData/.../MyApp.app"; APP_NAME=$(basename "$APP"); rsync -avE --delete "$APP" "$TARGET:/Applications/" && ssh "$TARGET" "echo Remote host: \$(hostname); codesign --force --deep -s - /Applications/$APP_NAME && open -n /Applications/$APP_NAME" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public extension Task where Success == Void , Failure == Never { | |
| // Suspends until the task is cancelled | |
| static func cancellation() async -> Void { | |
| let s = AsyncStream<Void>{ continuation in } | |
| for await _ in s { | |
| } | |
| } | |
| // EMITS INFINITE ELEMENTS CPU 100% |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // EnvironmentDimmedTintColorViewModifier.swift | |
| // Learn | |
| // | |
| // Created by Juan Arzola on 3/17/25. | |
| // Copyright © 2025 Juan Arzola. All rights reserved. | |
| // | |
| import SwiftUI | |
| import UIKit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import SwiftData | |
| extension PersistentIdentifier { | |
| var shortDebugDescription: String { | |
| let description = "\(self)" | |
| let entityNameRange = description.firstMatch(of: self.entityName)?.range | |
| let lastParenthesisRange = description.firstMatch(of: ")")?.range | |
| if let entityNameRange, let lastParenthesisRange, | |
| entityNameRange.lowerBound < lastParenthesisRange.upperBound { | |
| return String(description[entityNameRange.lowerBound..<lastParenthesisRange.lowerBound]) |
NewerOlder