- You must have BuildKit enabled in Docker.
- You must have
~/.ssh/config
set up with a proper alias for the server you want to access via SSH. - When referencing external resources via SSH, always use a proper domain name, never an SSH alias. In other words, use something like
[email protected]:foo/bar
. - Use the latest
Dockerfile
syntax using# syntax=docker/dockerfile:1.x
at the top.
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 | |
open class KeyboardAvoidingViewController: UIViewController { | |
private var observers: [NSObjectProtocol] = [] | |
open override func viewWillAppear(_ animated: Bool) { | |
super.viewWillAppear(animated) | |
let nc = NotificationCenter.default |
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
typealias Deserializer<I, O> = (I) -> O? | |
typealias JsonDeserializer<I, O> = (Json) -> Deserializer<I, O> | |
typealias JsonElementDeserializer = JsonDeserializer<JsonElement, JsonElement> | |
private fun <I, O> const(deserializer: Deserializer<I, O>): JsonDeserializer<I, O> = { | |
deserializer | |
} | |
infix fun <A, B, C> JsonDeserializer<A, B>.j( | |
next: JsonDeserializer<B, C> |
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
{-# LANGUAGE FlexibleContexts, FlexibleInstances, FunctionalDependencies #-} | |
module Parsy where | |
import Control.Monad.Error.Class | |
import Data.List (foldr1, singleton, (!!)) | |
import GHC.Base (empty) | |
import RIO hiding (optional) | |
import RIO.Char |
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 ComposableArchitecture | |
import SwiftUI | |
enum ValidationKey<Model>: Hashable { | |
case model | |
case key(PartialKeyPath<Model>) | |
} | |
@ObservableState | |
struct ValidationResult: Equatable { |
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
> {-# LANGUAGE FunctionalDependencies #-} | |
> module UserRepository where | |
This is an example of adapting the Repository pattern to Haskell using type classes, with the aim of decoupling data access from its interface for the purpose of writing better unit tests. Is this the best way to achieve this goal? Well, it's one way. | |
It makes the assumption that your application is using the ReaderT IO pattern promoted by libraries like rio. | |
First, we create a typeclass that contains our data access methods: |
OlderNewer