A small sketch for a composable validation library.
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
.theme-dark { | |
--dataview-key: #ffc94a; | |
--dataview-value: #ffffff; | |
} | |
.theme-light { | |
--dataview-key: #000; | |
--dataview-value: #000; | |
} |
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
// ==UserScript== | |
// @name Hypothesis | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description try to take over the world! | |
// @author AFuture | |
// @match *://*/* | |
// @grant none | |
// ==/UserScript== |
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
/** | |
* I use .app-container to get around CSS selector specificity | |
*/ | |
.app-container pre[class*="language-note-"] { | |
border: 2px solid; | |
} | |
/* Make the first line of note bold */ | |
*[class*="language-note"]::first-line { |
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
struct CustomViewModel { | |
let data: String | |
init(data: String) { | |
self.data = data | |
} | |
} | |
final class CustomViewController: ViewController<CustomViewModel> { | |
override func viewDidLoad() { |
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
import Foundation | |
// Some clearly non-NSObject-based models: | |
enum Coconut: String { | |
case small, medium, large | |
} | |
struct Tomato { | |
static var red = Tomato(color: #colorLiteral(red: 0.7490196078, green: 0.09803921569, blue: 0.02352941176, alpha: 1)) |
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
final class SampleViewController: StoryboardBackedViewController { | |
// Unfortunately this must be an IUO var, so that we can set the value after super.init | |
private var member: Foo! | |
// Proper dependency injection in a storyboard backed VC! | |
init(foo: Foo) { | |
super.init(storyboardIdentifier: "SampleViewControllerIdentifier") | |
// We have to set the members *after* calling super.init, since it changes the instance of `self`. | |
self.member = foo |
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
/** | |
* Using Operator Mono in Atom | |
* | |
* 1. Open up Atom Preferences. | |
* 2. Click the “Open Config Folder” button. | |
* 3. In the new window’s tree view on the left you should see a file called “styles.less”. Open that up. | |
* 4. Copy and paste the CSS below into that file. As long as you have Operator Mono SSm installed you should be golden! | |
* 5. Tweak away. | |
* | |
* Theme from the screenshot (http://cdn.typography.com/assets/images/blog/operator_ide2.png): |
NewerOlder