Do this once
sudo dseditgroup -o create brewCreate a brew group
| import Foundation | |
| // MARK: - Portable Game Notation (PGN). | |
| /// Portable Game Notation (PGN). | |
| /// https://en.wikipedia.org/wiki/Portable_Game_Notation | |
| struct PGN { | |
| typealias TurnNumber = UInt | |
| let counterparts: [Counterpart] |
| // Safely Modifying The View State (SwiftUI) | |
| // https://swiftui-lab.com | |
| // https://swiftui-lab.com/state-changes | |
| import SwiftUI | |
| struct CustomView: View { | |
| var body: some View { | |
| NavigationView { |
| import Cocoa | |
| import Foundation | |
| import AppKit | |
| import CoreFoundation | |
| import ApplicationServices | |
| /// https://jvns.ca/blog/2019/11/25/challenge--make-a-bouncy-window-manager/ | |
| /* | |
| This code runs the following sequence: |
Do this once
sudo dseditgroup -o create brew Create a brew groupDo this once
sudo dseditgroup -o create brew Create a brew group| Xcode Test Coverage |
xed is a command-line tool that launches the Xcode application and opens the given documents (xcodeproj, xcworkspace, etc.), or opens a new document, optionally with the contents of standard input.
If you work from the command line, this tool is a better option than open (which can open Xcode projects as well). Why?
xed knows about the current selected Xcode version (open behaves unpredictably if you have multiple Xcode installed)| import OSLog | |
| import XCTest | |
| extension OSLogStore { | |
| static func entities( | |
| subsystem: String? = nil, | |
| category: String? = nil | |
| ) throws -> [OSLogEntryLog] { | |
| let logStore = try OSLogStore(scope: .currentProcessIdentifier) | |
| let enumerator = try logStore.__entriesEnumerator(position: nil, predicate: nil) |
| import Foundation | |
| actor Auth { | |
| private var tokenRefresh: Task<String, Error>? | |
| private var _token: String? | |
| private var counter: Int = 0 | |
| func token() async throws -> String { | |
| if var tokenRefresh { |
| import UIKit | |
| enum StoredItem<V: Codable> { | |
| case item(key: String, value: V) | |
| case delete(key: String) | |
| init(key: String, value: V?) { | |
| self = .delete(key: key) | |
| } |