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
{-# LANGUAGE DataKinds #-} | |
{-# LANGUAGE FlexibleInstances #-} | |
{-# LANGUAGE GADTs #-} | |
{-# LANGUAGE KindSignatures #-} | |
-- Support for https://nunoalexandre.com/2018/01/28/a-case-for-dependent-types | |
data ValueType = StringType | IntType |
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
<?xml version="1.0" ?> | |
<items> | |
<item> | |
<title>IPode</level> | |
<price>1.15</price> | |
</item> | |
<item> | |
<title>iPadi</level> | |
<price>2.15</price> | |
</item> |
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
<?xml version='1.0' encoding='utf-8'?> | |
<items> | |
<item> | |
<additional_imagelinks>http://example.com/one.jpg</additional_imagelinks> | |
<additional_imagelinks>http://example.com/two.jpg</additional_imagelinks> | |
<additional_imagelinks>http://example.com/three.jpg</additional_imagelinks> | |
<profit>-9.4 EUR</profit> | |
<comma>-9,15</comma> | |
<numberz>--9.77EUR</numberz> | |
<numberpoints>-9..77EUR</numberpoints> |
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
### Command | |
``` bash | |
stack test --fast --test-arguments '-m "<identifier>"' | |
``` | |
The `<identifier>` can be pretty much anything: | |
- Part of / a module's name | |
- A `describe` / `it` description |
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
/// This module contains useful extensions to the base | |
/// navigation controllers in respect to managing orientation, | |
/// as well as adding missing functionality to the sdk types. | |
import Foundation | |
func currentOrientation() -> UIInterfaceOrientation { | |
return UIApplication.shared.statusBarOrientation | |
} |
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 | |
import SwiftKeychainWrapper | |
let keychain: KeychainWrapper = KeychainWrapper.standard | |
/// Add methods that allow a client to save and lookup Dict's. | |
extension KeychainWrapper { | |
func saveDict(_ value: [String: Any], forKey key: String) { | |
self.set(NSKeyedArchiver.archivedData(withRootObject: value), | |
forKey: key) |
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
class Slideshow: UIViewController { | |
let slides: [SlideView] | |
init(slides: [SlideView]) { | |
self.slides = slides | |
} | |
// UI & Layout code goes here... | |
} |
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
class Slideshow: UIView { | |
let slides: [SlideView] | |
// UI & Layout code goes here... | |
} | |
class SlideView: UIView { | |
let slide: Slide | |
// UI & Layout code goes here... |
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
let slideshow = Slideshow( | |
slides: [ | |
SlideView(index: 0), | |
SlideView(index: 1), | |
SlideView(index: 2) | |
] | |
) |
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
let slides = [ | |
Slide( | |
title: "Bobby Mcferrin", | |
description: "Jazz at its best", | |
image: UIImage(name: "BobbyMcferrin")! | |
), | |
Slide( | |
title: "Kurt Vile", | |
description: "A prolific creative", | |
image: UIImage(name: "KurtVile")! |
OlderNewer