Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 Cocoa | |
let given = "{\n\t\"test\": \"this 😃 \\ \",\n\r\t\"\'testing\': 1\r\n}\\ \0 \\" | |
let expected = #"{\n\t\"test\": \"this 😃 \\ \",\n\r\t\"\'testing\': 1\r\n}\\ \0 \\"# | |
let expectedAscii = #"{\n\t\"test\": \"this \u{0001F603} \\ \",\n\r\t\"\'testing\': 1\r\n}\\ \0 \\"# | |
extension String { | |
private static let escapedChars = [ | |
(#"\0"#, "\0"), | |
(#"\t"#, "\t"), | |
(#"\n"#, "\n"), |
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 Network | |
class ExternIP: ObservableObject { | |
@Published var address: String = "unknown" | |
@Published var isV6Supported: Bool = false | |
init() { | |
queue = DispatchQueue(label: "monitor") | |
monitor = NWPathMonitor() |
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
#if os(OSX) | |
import Cocoa | |
#else | |
import Foundation | |
#endif | |
/** | |
resolves a host names ip address for the specified family | |
- parameters: | |
- name: the host name to resolve |
OlderNewer