Or: “Everybody likes being given a glass of water.”
By Merlin Mann.
It's only advice for you because it had to be advice for me.
| enum Nullable<T>: Codable where T: Codable { | |
| case some(_ value: T) | |
| case null | |
| case undefined | |
| init(from decoder: Decoder) throws { | |
| let container = try decoder.singleValueContainer() | |
| if container.decodeNil() { | |
| self = .null | |
| } else { |
| #!/bin/bash | |
| # Place this file in `.git/hooks/` | |
| if which swiftlint >/dev/null; then | |
| swiftlint autocorrect | |
| else | |
| echo "warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint" | |
| fi | |
| git diff --diff-filter=d --staged --name-only | grep -e '\(.*\).swift$' | while read line; do |
| import Fluent | |
| func fetchChildren<Parent, ParentID, Child: Model, Result>( | |
| of parents: [Parent], | |
| idKey: KeyPath<Parent, ParentID?>, | |
| via reference: KeyPath<Child, ParentID>, | |
| on conn: DatabaseConnectable, | |
| combining: @escaping (Parent, [Child]) -> Result) -> Future<[Result]> where ParentID: Hashable & Encodable { | |
| let parentIDs = parents.compactMap { $0[keyPath: idKey] } | |
| let children = Child.query(on: conn) |
| ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key | |
| # Don't add passphrase | |
| openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub | |
| cat jwtRS256.key | |
| cat jwtRS256.key.pub |
| mr Marathi | |
| bs Bosnian | |
| ee_TG Ewe (Togo) | |
| ms Malay | |
| kam_KE Kamba (Kenya) | |
| mt Maltese | |
| ha Hausa | |
| es_HN Spanish (Honduras) | |
| ml_IN Malayalam (India) | |
| ro_MD Romanian (Moldova) |