This file contains 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
public protocol Diffable: Hashable { | |
var primaryKeyValue: String { get } | |
} | |
public struct AnyDiffable: Diffable { | |
private let _primaryKeyValue: () -> String | |
This file contains 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
/* | |
In response of Tom Lokhort's article. | |
A third alternative: alternative 2 under steroïds | |
--- | |
Source: http://tom.lokhorst.eu/2017/07/strongly-typed-identifiers-in-swift | |
*/ | |
struct GenericIdentifier<T>: RawRepresentable, Hashable, Equatable { | |
let rawValue: String |
This file contains 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
# turtle.py | |
# Basic Turtle graphics module for Pythonista | |
# | |
# When run as a script, the classic Koch snowflake is drawn as a demo. | |
# The module can also be used interactively or from other scripts: | |
# >>> from turtle import * | |
# >>> right(30) | |
# >>> forward(100) | |
# ... |