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
if presentationStyle == .compact { | |
controller = initateCompactVC() | |
} else { | |
controller = initateExpandVC() | |
} |
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
override func willTransition(to presentationStyle: MSMessagesAppPresentationStyle) {} | |
override func didTransition(to presentationStyle: MSMessagesAppPresentationStyle){} |
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
requestPresentationStyle(.expanded) | |
requestPresentationStyle(.compact) |
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 | |
var str = "Hello, playground" | |
let queue = DispatchQueue(label: "queue.1") | |
//To add some context, a queue is a block of code that can be run synchronously or asynchronously in either the main or background thread. | |
//When we use a queue, we can either use a global one that is provided to us by Apple, or we can create our own custom ones. It should be noted that global queues should be used cautiously as we wouldn’t want to abuse them. |
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
{ | |
"name": "node-js-getting-started", | |
"version": "0.3.0", | |
"description": "A sample Node.js app using Express 4", | |
"engines": { | |
"node": "8.9.1" | |
}, | |
"main": "index.js", | |
"scripts": { | |
"start": "node index.js", |
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
Install the mongodb server and run in the server | |
Shrawan-Temp-mac:bin shrawans$ mongod --dbpath ../../../mongoserver_DB/ |
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
Reference @marcexmachina | |
https://gist.github.com/marcexmachina/ab2f613e5208279b20194926a76dd511 | |
protocol APIClient { | |
var session: URLSession { get } | |
func fetch<T: Decodable>(with url: URL, completion: @escaping (Result<T>) -> Void) | |
} |
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 requests | |
import json | |
url = 'https://circleci.com/api/v1.1/project/github/VForgeLabs/CameraEatsFirstIos/tree/qa?circle-token=DFSDFSFDF' | |
payload = {"build_parameters": { "MANUAL_BUILD": "TRUE"}} | |
headers = {'content-type': 'application/json'} | |
r = requests.post(url, data=json.dumps(payload), headers=headers) | |
print (r.json()) |
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 getFBProfilePicUrl(){ | |
let request = FBSDKGraphRequest(graphPath: "me", parameters: ["fields": "id, name, first_name, last_name, email, picture.type(large)"]) | |
let _ = request?.start(completionHandler: { (connection, result, error) in | |
guard let userInfo = result as? [String: Any] else { return } | |
if let id = userInfo["id"] as? String { | |
appScopedUserId = id | |
} | |
}) | |
} |
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 loginManager: FBSDKLoginManager = FBSDKLoginManager() | |
loginManager.logIn(withReadPermissions: ["user_link"], from: fromViewController) { (result, error) in | |
if error != nil{ | |
return | |
}else if (result?.isCancelled)!{ | |
//Handle cancelation | |
}else{ | |
if (result?.grantedPermissions.contains("user_link"))!{ | |
//success |
OlderNewer