Skip to content

Instantly share code, notes, and snippets.

View frankus's full-sized avatar

Frank Schmitt frankus

  • Bellingham, WA, USA
View GitHub Profile
@frankus
frankus / Top 25 "Best" Wordle Openers
Last active January 19, 2022 00:51
Attempt to find the best starting words in Wordle (maximize chance of getting a green letter)
cares
saree
sores
seres
bares
soree
soras
cores
sires
sared
@frankus
frankus / JSONDecoder+HexData.swift
Created March 7, 2023 16:33
JSONDecoder data decoding strategy for hexadecimal strings
struct MyStruct: Decodable {
let data: Data
static func decodeHexData(_ decoder: Decoder) throws -> Data {
let container = try decoder.singleValueContainer()
let stringValue = try container.decode(String.self)
guard let data = Data(hexString: stringValue) else {
throw MyStructError.invalidHexString(stringValue)
}