I hereby claim:
- I am marksands on github.
- I am marksands (https://keybase.io/marksands) on keybase.
- I have a public key ASCiHMudz2diWLv9Nu36oOAK8MPoacliJ3oPi89JfulWngo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
public protocol OptionalDateValueCodableStrategy { | |
associatedtype RawValue: Codable | |
static func decode(_ value: RawValue?) throws -> Date? | |
static func encode(_ date: Date?) -> RawValue? | |
} | |
@propertyWrapper | |
public struct OptionalDateValue<Formatter: OptionalDateValueCodableStrategy>: Codable { |
struct PerformActionSideEffect<Output, Failure: Error> { | |
private let publisher: AnyPublisher<Output, Failure> | |
init<P: Publisher>(_ publisher: P) where P.Output == Output, P.Failure == Failure { | |
self.publisher = publisher.eraseToAnyPublisher() | |
} | |
@discardableResult | |
func performSink(_ action: @escaping (Output) -> Void) -> PerformActionSideEffect { | |
publisher.subscribe( |
import UIKit | |
extension CGRect { | |
public static var unbounded: CGRect { | |
return CGRect(origin: .zero, size: .unbounded) | |
} | |
public var center: CGPoint { | |
return CGPoint(x: midX, y: midY) | |
} |
import PlaygroundSupport | |
import UIKit | |
import Foundation | |
import Vision | |
func part2layer() -> [String] { | |
let layers = Array(input).chunks(ofSize: 25 * 6) | |
var picture = Array(repeating: "2", count: 25 * 6) | |
layers.forEach { layer in |
enum Direction { | |
case up, down, left, right | |
} | |
protocol PositionType { | |
var x: Int { get } | |
var y: Int { get } | |
} | |
func euclideanDistance(_ lhs: PositionType, _ rhs: PositionType) -> Double { |
class Database { | |
private static let users = [User(id: 1, name: "Jane"), User(id: 2, name: "Clara"), User(id: 3, name: "Sandy")] | |
static func find(id: Int) -> User? { | |
return users.first(where: { $0.id == id }) | |
} | |
static func find(name: String) -> User? { | |
return users.first(where: { $0.name == name }) | |
} |
func =(_ lhs: UInt8, _ rhs: UInt8) -> UInt8 { return 0 } | |
struct WHelper { | |
subscript(_ a: (UInt8, UInt8) -> (UInt8)) -> () -> Void { | |
get { return { } } | |
} | |
} | |
func w(_ a: () -> Void) -> WHelper { | |
return WHelper() |
class API { | |
func obtainIds() -> Observable<[Int]> { | |
return .just([1,2,3,4]) | |
} | |
} | |
class ViewModel { | |
let update: AnyObserver<Void> | |
let dataUpdated: Observable<[String]> |