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 Foundation | |
func withCStrings(_ strings: [String], scoped: ([UnsafeMutablePointer<CChar>?]) throws -> Void) rethrows { | |
let cStrings = strings.map { strdup($0) } | |
try scoped(cStrings + [nil]) | |
cStrings.forEach { free($0) } | |
} | |
enum RunCommandError: Error { | |
case WaitPIDError |
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
extension View { | |
public func debugView<T: View>(_ type: T.Type, file: String = #filePath, line: UInt = #line) -> some View { | |
#if DEBUG | |
return background(DebugView(type: type, file: file, line: line)) | |
#else | |
return self | |
#endif | |
} | |
} |
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
1. Make sure Mac and Apple TV have the same network ("AirPlay and HomeKit", "Allow Access" is set to "Anyone in the Same Network") | |
2. In Xcode open "Devices & Simulators" window | |
3. On Apple TV open "Remote App And Device" -> "Remote App And Device" | |
4. Click "pair" and enter code | |
5. If "pair" reapear again then turn off the wifi on your Mac for 10 seconds and then turn it on again (https://developer.apple.com/forums/thread/108459) | |
6. Maybe needed to delete the TV from ingored list https://stackoverflow.com/a/63195311/3614746 |
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 <UIKit/UIKit.h> | |
@interface ApplicationDelegateProxyType () | |
@property (nonnull, nonatomic) NSArray<id <UIApplicationDelegate>> *objects; | |
@end | |
@implementation ApplicationDelegateProxyType |
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
require 'webrick' | |
require 'webrick/https' | |
require 'openssl' | |
require 'json' | |
# curl https://localhost:port/test (pass '-k' to accept self signed certificate) | |
# openssl req -x509 -newkey rsa:4096 -keyout priv.pem -out cert.pem -days 365 -nodes | |
# cert = OpenSSL::X509::Certificate.new File.read 'cert.pem' | |
# pkey = OpenSSL::PKey::RSA.new File.read 'priv.pem' |