This snippet has been released as a full open-source library. Check it out at TestCleaner!
View Dismiss Disk Not Ejected Properly Dialogs.scpt
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 |
View ContentView.swift
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)) |
View TypedMutableCopying.swift
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 } | |
} |
View XCTestCase+Extensions.swift
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 { |
View File_1.json
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" | |
} |
View RxSignpost.swift
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, |
View .lldbinit
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 |
View guard.swift
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 } |
View gist:8b09604250cc903daa6a92b7c930f688
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
hello, world |
NewerOlder