This file contains hidden or 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
| struct ContentView: View { | |
| @State private var isModalPresented = false | |
| var body: some View { | |
| VStack { | |
| Button { | |
| isModalPresented = true | |
| } label: { | |
| Text("Present Modal") | |
| } |
This file contains hidden or 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
| // | |
| // PacManLoader.swift | |
| // ScriptReader | |
| // | |
| // Created by Ben Harraway on 14/04/2025. | |
| // | |
| import SwiftUI | |
| struct PacManLoader: View { | |
| @State private var progress: CGFloat = 1.0 |
This file contains hidden or 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 AppKit | |
| import Charts | |
| import CoreVideo | |
| import SwiftUI | |
| struct FPSMeasurement: Identifiable, Equatable { | |
| let id: Int | |
| let fps: Int | |
| static func == (lhs: FPSMeasurement, rhs: FPSMeasurement) -> Bool { |
This file contains hidden or 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 Dispatch | |
| import Foundation | |
| import UIKit | |
| extension DispatchQueue { | |
| /// Run the action immediately if it's on the main thread, otherwise dispatch it to the main thread asynchronously. | |
| public static func onMainThread(_ action: @escaping () -> Void) { | |
| if Thread.isMainThread { | |
| action() | |
| } else { |
This file contains hidden or 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
| // | |
| // ViewController.swift | |
| // UIMenu-Demo | |
| // | |
| // Created by Seb Vidal on 28/05/2024. | |
| // | |
| import UIKit | |
| class ViewController: UIViewController { |
This file contains hidden or 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 { | |
| @State var show = false | |
| @State var height: CGFloat = 250 | |
| var body: some View { | |
| List { | |
| Button("Pop Sheet") { | |
| height = 250 | |
| show.toggle() |
This file contains hidden or 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
| #!/usr/bin/env osascript -l JavaScript | |
| const App = Application.currentApplication(); | |
| App.includeStandardAdditions = true; | |
| const kCFPrefsFeatureFlagsDir = '/Library/Preferences/FeatureFlags/Domain'; | |
| const kCFPrefsFeatureEnabledKey = 'Enabled'; | |
| const kUIKitDomainPrefsTemporaryPath = '/tmp/UIKit.plist'; | |
| const kUIKitRedesignedTextCursorKey = 'redesigned_text_cursor'; |
This file contains hidden or 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
| @discardableResult | |
| func run<T>(_ operation: () async throws -> T, | |
| defer deferredOperation: () async throws -> Void) async throws -> T { | |
| do { | |
| let result = try await operation() | |
| try await deferredOperation() | |
| return result | |
| } catch { | |
| try await deferredOperation() | |
| throw error |
This file contains hidden or 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 | |
| import Charts | |
| import GameplayKit | |
| let gaussianRandoms = GKGaussianDistribution(lowestValue: 0, highestValue: 20) | |
| func date(year: Int, month: Int, day: Int = 1) -> Date { | |
| Calendar.current.date(from: DateComponents(year: year, month: month, day: day)) ?? Date() | |
| } |
This file contains hidden or 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
| #objective-c xrefs hopper script | |
| #rewrite the IDAPython script https://github.com/fireeye/flare-ida/blob/master/python/flare/objc2_xrefs_helper.py | |
| #author: Kai Lu(@k3vinlusec) | |
| #editor: Zhuoli Li(@dreampiggy) | |
| def getRefPtr(doc,classMethodsVA,objcSelRefs, objcMsgRefs, objcConst): | |
| ret = (None, None) | |
| namePtr = doc.readUInt64LE(classMethodsVA) #get name field in struct __objc_method, it's selector | |
| ctn = 0 |
NewerOlder