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 | |
protocol Vector { | |
associatedtype Primitive: FloatingPoint | |
var components: [Primitive] { get } | |
init(components: [Primitive]) | |
} | |
extension CGPoint: Vector { | |
var components: [CGFloat] { [x, y] } |
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 simd | |
enum Input: String, CaseIterable { | |
case up = "▴" | |
case right = "▸" | |
case down = "▾" | |
case left = "◂" | |
var bytes: [UInt8] { |
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
#!/usr/bin/env swift | |
import Foundation | |
struct TerminationStatus: Error { | |
let code: Int32 | |
} | |
func run(_ command: Command) throws { | |
print(command.rendered.joined(separator: " ")) |
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
// | |
// NibLoadable.swift | |
// Reusable | |
// | |
// Copyright (c) <2018>, Gabriel O'Flaherty-Chan | |
// All rights reserved. | |
// | |
// Redistribution and use in source and binary forms, with or without | |
// modification, are permitted provided that the following conditions are met: | |
// 1. Redistributions of source code must retain the above copyright |
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
// | |
// Reusable.swift | |
// Reusable | |
// | |
// Copyright (c) <2018>, Gabriel O'Flaherty-Chan | |
// All rights reserved. | |
// | |
// Redistribution and use in source and binary forms, with or without | |
// modification, are permitted provided that the following conditions are met: | |
// 1. Redistributions of source code must retain the above copyright |