This snippet has been released as a full open-source library. Check it out at TestCleaner!
This file contains 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 CoreGraphics.CGBase | |
import RealityKit | |
import UIKit | |
/// The ratio of the resource’s width to its height. | |
/// - `...1` is portrait | |
/// - `1` is square | |
/// - `1...` is landscape | |
public enum AspectRatio: Equatable, Comparable, Codable, Sendable { | |
case portrait(Double) |
This file contains 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
tell application "System Events" to tell process "Notification Center" | |
repeat with notificationWindow in windows | |
tell notificationWindow | |
set entireContents to entire contents | |
repeat with content in reverse of entireContents -- iterate backwards so we close bottom notifications first, if that matters | |
if class of content is group then | |
set groupStaticTexts to static texts of content | |
repeat with staticText in groupStaticTexts | |
set foundText to false | |
if value of staticText is equal to "Disk Not Ejected Properly" then |
This file contains 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 SwiftUI | |
struct ContentView: View { | |
var body: some View { | |
NicerButton(action: {}, label: { isPressed in | |
Text("Rabbit Season") | |
.foregroundColor(Color.white) | |
.frame(width: 200) | |
.padding() | |
.background(Color.blue.brightness(isPressed ? -0.3 : 0)) |
This file contains 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 Foundation | |
protocol TypedMutableCopying { | |
associatedtype ConstantVersion | |
associatedtype MutableVersion | |
var typedCopy: ConstantVersion { get } | |
var typedMutableCopy: MutableVersion { get } | |
} |
This file contains 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
// | |
// XCTestCase+Unwrapping.swift | |
// Created by Zev Eisenberg on 6/2/19. | |
// Feel free to use, share, etc. No need to credit, but a link back to this page would be nice. | |
// | |
import XCTest | |
extension XCTestCase { |
This file contains 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
{ | |
"some key": "some value" | |
} |
This file contains 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
// RxSwift signposts | |
import os.signpost | |
import RxSwift | |
func signpost<T>(log: OSLog, name: StaticString, value: String, _ thing: () throws -> T) rethrows -> T { | |
let signpostID = OSSignpostID(log: log) | |
os_signpost( | |
.begin, |
This file contains 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
command script import ~/.lldbscripts/break_unsatisfiable.py |
This file contains 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
let foo: Int? = nil | |
let bar: Int? = nil | |
let baz: Int? = nil | |
func x() { | |
guard | |
let foo = foo, | |
let bar = bar, | |
let baz = baz | |
else { return } |
NewerOlder