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
public protocol PaginationServiceType { | |
associatedtype Element | |
init(elementProvider: (page: Int, numberOfElements: Int) -> SignalProducer<[Element], NoError>) | |
func fetchNextPage(numberOfElements: Int) -> SignalProducer<[Element], NoError> | |
} |
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
protocol UIComponentType { | |
associatedtype Controller | |
associatedtype View | |
associatedtype ViewModel | |
func createController() -> Controller | |
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
public final class MyViewController: UIViewController { | |
@IBOutlet weak var someView: UIView! | |
@IBOutlet weak var someLabel: UIView! | |
@IBOutlet weak var someButton: UIView! | |
@IBOutlet weak var otherView: UIView! | |
@IBOutlet weak var yetAnotherView: UIView! |
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
protocol Downloader { | |
func fetch(from url: SecureURLType) | |
} | |
protocol SecureURLType { | |
init?(from url: URL, validator: URL -> Bool) | |
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
# Your init script | |
# | |
# Atom will evaluate this file each time a new window is opened. It is run | |
# after packages are loaded/activated and after the previous editor state | |
# has been restored. | |
# | |
# An example hack to log to the console when each text editor is saved. | |
# | |
# atom.workspace.observeTextEditors (editor) -> | |
# editor.onDidSave -> |
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
# Raspberry PI (RPI) 3 configuration with Mac OSx. | |
# 1) Connect SD card to mac (you would need an adapter). | |
# 2) Find the disk partition. | |
diskutil list | |
# 3) Once located, format SD card to FAT32. <disk> was /dev/disk0 in my case. | |
sudo diskutil eraseDisk FAT32 RASPBIAN MBRFormat <disk> |
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
function* watchTokenExpire() { | |
let action = yield take(UPDATE_TOKEN_EXPIRE); | |
while (true) { | |
if (action.payload.shouldRefresh) { | |
yield fetchNewTokenOrLogout(); | |
} else { | |
const expireInMs = (action.payload.expireIn * 1000) - MIN_TOKEN_LIFESPAN; | |
const raceResult = yield race({ | |
action: take(UPDATE_TOKEN_EXPIRE), | |
timeout: delay(expireInMs), |
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
DEFAULT_SIMULATORS = ['iPhone 5s', 'iPhone 8', 'iPhone X', 'iPhone Xʀ'] | |
PROJECT_PATH = # Project path. | |
SCHEME = ... # (Your scheme) | |
CONFIGURATION = ... # (usually Debug or Release) | |
APP_ID = # Your app id. i.e: com.company.app | |
APP_NAME = # The output name of your app. | |
platform :ios do |
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 Foundation | |
let jsonString: String = """ | |
{ "action": {"dynamicKey": [{"active": false}]}, | |
"schedule": "00 09 * * 1,2,3,4,5", | |
"tz": "America.Chicago"} | |
""" | |
let jsonData = jsonString.data(using: .utf8)! | |
struct Action { |
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 Foundation | |
protocol UserProvider { | |
func logIn(onSuccess: (User) -> (), onFailure: (Error) -> ()) | |
} | |
protocol UserRepositoryProtocol { | |
} |