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
/// CLOSURE EXAMPLE | |
func transactionExample(completion: (Result<Any, Error>) -> Void) { | |
let sfReference = db.collection("cities").document("SF") | |
db.runTransaction({ (transaction, errorPointer) -> Any? in | |
let sfDocument: DocumentSnapshot | |
do { | |
try sfDocument = transaction.getDocument(sfReference) | |
} catch let fetchError as NSError { |
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
var heyJude = "" | |
for verse in 0..<4 { | |
heyJude += "Hey Jude, don't " | |
switch verse { | |
case 0, 3: | |
heyJude += "make it bad\nTake a sad song and make it better" | |
case 1: | |
heyJude += "be afraid\nYou were made to go out and get her" | |
case 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
func removeAudio(_ completion: @escaping RemoveAudioResponse) { | |
let fileManager = FileManager.default | |
let composition = AVMutableComposition() | |
let sourceAsset = AVURLAsset(url: self) | |
let compositionVideoTrack = composition.addMutableTrack(withMediaType: AVMediaType.video, preferredTrackID: kCMPersistentTrackID_Invalid) |
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
20:28:40.290 💙 INFO MessagingManager.fetchAccessToken():163 - New Token👑 | |
20:28:56.646 ❤️ ERROR MessagingManager.initializeClient():101 - Error Domain=signal.sdk.domain.error Code=102 "Error validating token." UserInfo={kTCHErrorMsgKey=Error validating token., NSLocalizedDescription=Error validating token.} | |
0x16ef9b000 | 05/14/20:28:56.702 | DEBUG | 6 | TNHttpTransportClient | ~TNHttpTransportClient - begin | |
0x16ef9b000 | 05/14/20:28:56.702 | DEBUG | 6 | TNHttpTransportClient | ~TNHttpTransportClient - end | |
20:28:56.734 💙 INFO MessagingManager.fetchAccessToken():163 - New Token👑 | |
20:29:11.837 ❤️ ERROR MessagingManager.initializeClient():101 - Error Domain=signal.sdk.domain.error Code=102 "Error validating token." UserInfo={kTCHErrorMsgKey=Error validating token., NSLocalizedDescription=Error validating token.} | |
0x16f13f000 | 05/14/20:29:11.873 | DEBUG | 18 | TNHttpTransportClient | ~TNHttpTransportClient - begin | |
0x16f13f000 | 05/14/20:29:11.874 | DEBUG | 18 |
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 UIKit based Playground for presenting user interface | |
import UIKit | |
import AVFoundation | |
import PlaygroundSupport | |
let arcPoint = CGPoint(x: 170, y: 200) | |
func BezierPath(center: CGPoint) -> CGPath { | |
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 | |
class Diamond: NSObject { | |
//MARK: - Canvas Drawings | |
/// Page 1 | |
class func drawDiamond(frame targetFrame: CGRect = CGRect(x: 0, y: 0, width: 50, height: 50), resizing: ResizingBehavior = .aspectFit) { |
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
// Created by Caleb Davenport on 7/14/17. | |
import UIKit | |
final class ActionSheetPresentationController: UIPresentationController { | |
// MARK: - Properties | |
private var dimmingView: UIView! |
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
var http = require('http'); | |
var url = require('url'); | |
function webhook(urlStr, data, cb) { | |
var postData = JSON.stringify(data); | |
var options = url.parse(urlStr); | |
options.method = 'POST'; | |
options.headers = {'Content-Type': 'application/json', 'Content-Length': postData.length}; |