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
# Add to your zsh profile | |
function devicepid() { | |
if [ -z "$1" ]; then | |
echo "Usage: devicepid <device-name> <search>" | |
echo "Example: devicepid 'iPhone 15 Pro Max' SpringBoard" | |
return 1 | |
fi | |
if [ -z "$2" ]; 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 PinEntryView: View { | |
var pinLimit: Int = 4 | |
var isError: Bool = false | |
var canEdit: Bool = true | |
@Binding var pinCode: String | |
private var pins: [String] { |
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
/* | |
MIT License | |
Copyright (c) 2024 Maxwell Zeryck | |
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: | |
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTW |
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
// http://defagos.github.io/yet_another_article_about_method_swizzling/ (Thank you!!) | |
// Returns the original implementation | |
static _Nullable IMP pspdf_swizzleSelector(Class clazz, SEL selector, IMP newImplementation) { | |
NSCParameterAssert(clazz); | |
NSCParameterAssert(selector); | |
NSCParameterAssert(newImplementation); | |
// If the method does not exist for this class, do nothing. | |
const Method method = class_getInstanceMethod(clazz, selector); | |
if (!method) { |
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 UIKit | |
@UIApplicationMain | |
class AppDelegate: UIResponder, UIApplicationDelegate { | |
var window: UIWindow? | |
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool { | |
let window = UIWindow(frame: UIScreen.main.bounds) |
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 UIKit | |
/// A validation rule for text input. | |
public enum TextValidationRule { | |
/// Any input is valid, including an empty string. | |
case noRestriction | |
/// The input must not be empty. | |
case nonEmpty | |
/// The enitre input must match a regular expression. A matching substring is not enough. | |
case regularExpression(NSRegularExpression) |
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
""" File: nudge.py | |
An lldb Python script to add a nudge command. | |
Add to ~/.lldbinit: | |
command script import ~/path/to/nudge.py | |
Usage: | |
(lldb) nudge x-offset y-offset [view] |
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
# full diff | |
git diff <SHA1> <SHA1> -- `find . -name '<pattern>'` | |
# only file names | |
git diff <SHA1> <SHA1> --name-status -- `find . -name '<pattern>'` |
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
// | |
// PSPDFGenerics.h | |
// PSPDFFoundation | |
// | |
// PSPDFKit is the leading cross-platform solution for integrating PDFs into your apps: https://pspdfkit.com. | |
// Try it today using our free PDF Viewer app: https://pdfviewer.io/ | |
// | |
// This file is MIT licensed. | |
/** |
NewerOlder