Skip to content

Instantly share code, notes, and snippets.

View mcritz's full-sized avatar
🐰
🐰🐰🐰🐰🐰🐰🐰🐰🐰

Michael Critz mcritz

🐰
🐰🐰🐰🐰🐰🐰🐰🐰🐰
View GitHub Profile
import Foundation
enum StoredObject: Codable {
case all(groups: [InterestGroup]?)
case selected(group: InterestGroup?)
case events(groupID: UUID, events: [Event]?)
func url(root url: URL) -> URL {
switch self {
case .all:
@mcritz
mcritz / EquatableThroughMirror.swift
Last active February 18, 2020 22:58
EquatableThroughMirror: compare two Types and return true if their properties and values are identical
import Foundation
/// Create a custom operator
infix operator =≈=
/// Equatable through introspection
/// Compares lhs to rhs and returns true of both sides have the same property names and values
/// - Parameters:
/// - lhs: lefthand side
/// - rhs: righthand side
func =≈= <T>(lhs: T, rhs: T) -> Bool {
@mcritz
mcritz / dabblet.css
Created April 23, 2012 04:05 — forked from chriscoyier/dabblet.css
Untitled
body {
font-family: sans-serif;
}
ul {
list-style: none
}
li {
background: slategrey;