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
osascript -e 'tell application "iOS Simulator" to quit' | |
osascript -e 'tell application "Simulator" to quit' | |
xcrun simctl erase all |
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
function fixXcode | |
{ | |
pushd > /dev/null | |
cd | |
xcodepath=`xcode-select --print-path`/.. | |
destination=$xcodepath/Frameworks/IDEKit.framework/Versions/A/Resources/SystemCodeSnippets.codesnippets | |
shouldRelaunchXcode=false | |
if [[ `osascript -e 'tell app "System Events" to count processes whose name is "Xcode"'` == 1 ]]; 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
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
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
// 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
The MIT License (MIT) | |
Copyright (c) 2016 Zev Eisenberg | |
Permission is hereby granted, free of charge, to any person obtaining a copy of | |
this software and associated documentation files (the "Software"), to deal in | |
the Software without restriction, including without limitation the rights to | |
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | |
the Software, and to permit persons to whom the Software is furnished to do so, | |
subject to the following conditions: |
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 } | |
} |
NewerOlder