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 | |
class Storage { | |
fileprivate init() { } | |
enum Directory { | |
case documents | |
case caches | |
} | |
/// Returns URL constructed from specified directory | |
static fileprivate func getURL(for directory: Directory) -> URL? { |
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
class JSONAny: Codable { | |
public let value: Any | |
public init<T>(_ value: T?) { | |
self.value = value ?? () | |
} | |
static func decodingError(forCodingPath codingPath: [CodingKey]) -> DecodingError { | |
let context = DecodingError.Context(codingPath: codingPath, debugDescription: "Cannot decode JSONAny") | |
return DecodingError.typeMismatch(JSONAny.self, context) |
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 | |
# This script builds the iOS and Mac openSSL libraries | |
# Download openssl http://www.openssl.org/source/ and place the tarball next to this script | |
# Credits: | |
# https://github.com/st3fan/ios-openssl | |
# https://github.com/x2on/OpenSSL-for-iPhone/blob/master/build-libssl.sh | |