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
// | |
// OCXML.swift | |
// Created by Marco Arment on 9/23/24. | |
// | |
// Released into the public domain. Do whatever you'd like with this. | |
// No guarantees that it'll do anything, or do it correctly. Good luck! | |
// | |
import Foundation |
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
// Author: SwiftUI-Lab (swiftui-lab.com) | |
// Description: this learning tool is designed to showcase the different | |
// Grid and GridRow view options, added in SwiftUI 2022. It is part of the | |
// blog article: https://swiftui-lab.com/eager-grids | |
// | |
import SwiftUI | |
import UniformTypeIdentifiers | |
// The root view of the application | |
struct ContentView: 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
#!/usr/bin/swift | |
import Foundation | |
func processFile(_ path: String, keyPrefix: String?) { | |
guard let file = freopen(path, "r", stdin) else { | |
fputs("Failed to open file.\n", stderr) | |
return | |
} | |
defer { | |
fclose(file) |
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
#!/bin/env sh | |
disable_suggestions() { | |
if [ -d "$1" ]; then | |
pushd "$1" || return | |
find . -name com.apple.suggestions.plist \ | |
-exec echo {} \; \ | |
-exec plutil -replace SuggestionsAppLibraryEnabled -bool NO {} \; | |
popd || return | |
fi |
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
class LeakCheckTestCase: XCTestCase { | |
private var excludedProperties = [String: Any]() | |
private var weakReferences = NSMapTable<NSString, AnyObject>.weakToWeakObjects() | |
// MARK: - SetUp | |
override func setUpWithError() throws { | |
try super.setUpWithError() |
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 Combine | |
import Foundation | |
/// This protocols allows you to declare your type as having a distinct network | |
/// representation. | |
/// | |
/// Rather than writing and maintaining a custom `Decodable` implementation for | |
/// your type, declare a brand new struct that exactly matches the expected | |
/// network response, and then write an initializer for your actual type that | |
/// accepts a `NetworkResponse`. |
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
extension UIHostingController { | |
convenience public init(rootView: Content, ignoreSafeArea: Bool) { | |
self.init(rootView: rootView) | |
if ignoreSafeArea { | |
disableSafeArea() | |
} | |
} | |
func disableSafeArea() { |
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
// | |
// FakeSettingsView.swift | |
// FakeSettings | |
// | |
// Created by Alex Melnychuck on 8/26/20. | |
// | |
// The goal of this 15min project is to showcase just how easy it is to | |
// fake an iOS settings screen. No photoshop text errors, no | |
// inconsistencies to reconcile–just a really convincing fake |
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
// | |
// OSLogStream.swift | |
// LoggingTest | |
// | |
// Created by Peter Steinberger on 24.08.20. | |
// | |
// Requires importing https://github.com/apple/llvm-project/blob/apple/master/lldb/tools/debugserver/source/MacOSX/DarwinLog/ActivityStreamSPI.h via bridging header | |
import Foundation |
NewerOlder