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
rules_version = '2'; | |
service cloud.firestore { | |
match /databases/{database}/documents { | |
// Create `Path` from array of string. | |
function documentPath(paths) { | |
return path([ | |
['databases', database, 'documents'].join('/'), | |
paths.join('/') | |
].join('/')); | |
} |
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 ModelA: Codable { | |
@Wrap<ModelA> var a: String? = "foobar" | |
} |
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
extension AnyObserver { | |
static func create<E>(_ relay: PublishRelay<E>) -> AnyObserver<E> { | |
return .init { event in | |
guard case let .next(value) = event else { return } | |
relay.accept(value) | |
} | |
} | |
static func create<E>(_ relay: BehaviorRelay<E>) -> AnyObserver<E> { | |
return .init { event in |
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 * as functions from 'firebase-functions' | |
import * as request from 'request-promise-native' | |
export namespace IssueDynamicLink { | |
export interface Request { | |
params: DynamicLinkParameters | |
} | |
export interface Response { | |
url: 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
//: Playground - noun: a place where people can play | |
import UIKit | |
import RxSwift | |
import RxCocoa | |
import PlaygroundSupport | |
PlaygroundPage.current.needsIndefiniteExecution = true | |
// PublishRelay vs BehaviorRelay | |
do { |
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 UIKit | |
import RxSwift | |
import RxCocoa | |
import PlaygroundSupport | |
PlaygroundPage.current.needsIndefiniteExecution = true | |
// PublishRelay vs BehaviorRelay | |
do { | |
let relay = PublishRelay<Int>() |
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
service cloud.firestore { | |
match /databases/{database}/documents { | |
function isAuthenticated() { | |
return request.auth != null; | |
} | |
match /user/{userID} { | |
allow read: if isAuthenticated(); | |
allow create: if true; | |
allow update: if request.writeFields.size() == 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
protocol PushNotificationPayload: Decodable { | |
} | |
protocol SubscribeContainer { | |
func parse(_ json: Data) | |
} | |
extension SubscribeContainer { | |
func parse(_ json: Data) { |
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
[##][A-Za-zA-Za-z一-鿆0-90-9ぁ-ヶヲ-゚ー]+ | |
// http://qiita.com/corin8823/items/75309761833d823cac6f |
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
protocol DataSourceSection { | |
associatedtype Element | |
var elements: [Element] { get } | |
} | |
protocol DataSource { | |
associatedtype Section: DataSourceSection | |
var sections: [Section] { get } | |
} |