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
public struct Error: ErrorType { | |
let source: String; let reason: String | |
public init(_ source: String = __FILE__, _ reason: String) { | |
self.reason = reason; self.source = source | |
} | |
} | |
protocol Contextualizable {} | |
extension Contextualizable { | |
func functionContext(function : String = __FUNCTION__) -> String { |
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/env xcrun swift | |
// $ chmod +x script.swift | |
// $ ./script.swift | |
// or $ ./script.swift -xcode=/Applications/Xcode-beta.app | |
import Foundation | |
@noreturn private func failWithError(message: String) { | |
print("🚫 \(message)") |
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
// gem install cocoapods-playgrounds | |
// pod playgrounds LibYAML | |
// Update: @floriankugler had a great idea to use UnsafeBufferPointer | |
// Paste in the following: | |
import LibYAML | |
public struct YAMLError: ErrorType { |
OlderNewer