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
| internal protocol AnyOptional {} | |
| extension Optional: AnyOptional {} | |
| // MARK: - parameter | |
| public typealias ParameterName = String | |
| public protocol AnyParameter { | |
| var name: ParameterName { get } |
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 os | |
| def pbcopy(text): | |
| command = 'echo ' + text.strip() + '| pbcopy' | |
| os.system(command) | |
| def getValue(x): | |
| value = lldb.frame.EvaluateExpression(x) | |
| if (value.TypeIsPointerType()): | |
| ret = value.GetObjectDescription() |
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 Darwin | |
| import Foundation.NSData | |
| import Dispatch | |
| // TODO: check for memory leaks - should manage most of pointers manually? | |
| struct Cuckoo { | |
| static var workdir: String { | |
| get { | |
| String(cString: getwd(nil)) |
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
| #!/bin/bash | |
| hidutil property --set '{"UserKeyMapping": | |
| [{"HIDKeyboardModifierMappingSrc":0x700000064, | |
| "HIDKeyboardModifierMappingDst":0x700000035}] | |
| }' |
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
| @propertyWrapper | |
| internal final class Unowned<Wrapped> { | |
| private let wrapper: Wrapper | |
| fileprivate init(wrapper: Wrapper) { | |
| self.wrapper = wrapper | |
| } | |
| internal var wrappedValue: Wrapped { | |
| get { wrapper.get() } |
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
| @dynamicMemberLookup | |
| internal enum MigrationProxy { | |
| case null | |
| case bool(Bool) | |
| case integer(Int) | |
| case float(Double) | |
| case string(String) | |
| case array(Array<MigrationProxy>) | |
| case dictionary(Dictionary<String, MigrationProxy>) |
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 | |
| import CommonCrypto | |
| internal enum CryptoError: Error { | |
| case emptyData | |
| case invalidData | |
| case invalidKey | |
| case fail(status: CCStatus) | |
| } |
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 | |
| internal struct Storage<Object: Codable> { | |
| var load: () throws -> Object | |
| var store: (Object) throws -> Void | |
| } | |
| internal enum StorageError: Error { | |
| case cannotAccessFile | |
| } |
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 | |
| import ObjectiveC | |
| private var originalAdditionalSafeAreaInsetsKey: Int = 0 | |
| open class KeyboardAwareViewController: UIViewController { | |
| open class var backgroundTapEditingEndHandlerEnabled: Bool { true } | |
| private var originalAdditionalSafeAreaInsets: UIEdgeInsets? { | |
| get { |
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 | |
| internal protocol AnyOptional { | |
| var isNone: Bool { get } | |
| } | |
| extension Optional: AnyOptional { | |
| var isNone: Bool { | |
| switch self { | |
| case .none: return true |