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
### 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
<?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
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
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
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 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")! |
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
@discardableResult | |
func downloadSpecificActivity(activityInfo: SpecificActivityFirebase, completion: @escaping ((URL?, Error?) -> Void), progress: ((Double?) -> Void)? = nil) -> ContentDownload? { | |
if SettingsManager.shared.wifiOnlyEnabled && SettingsManager.shared.reachabilityManager?.isReachableOnWWAN ?? false { | |
completion(nil, ContentError.notAllowedOnWWanError) | |
} else if SettingsManager.shared.reachabilityManager != nil && !SettingsManager.shared.reachabilityManager!.isReachable { | |
completion(nil, ContentError.notConnected) | |
} else { | |
let downloadStartDate = Date.now() | |
if let tempUrl = temporaryDownloadUrl(forSpecificActivity: activityInfo) { |
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
@discardableResult | |
func attemptDownload(forItem item: Item) -> Promise<URL> { | |
if !canSubmitDownload(forItem: item) { | |
return Promise.reject(DownloadError.duplicatedDownload) | |
} | |
else if !SettingsManager.shared.canDownloadOrStream() { | |
let error = DownloadError.canNotUseInternet | |
self.registerFailedDownload(item, withError: error) | |
return Promise.reject(error) | |
} |
OlderNewer