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
const geoCode = (address,callback) => { | |
setTimeout(() => { | |
const data = { | |
latitude:0, | |
longitude:0 | |
} | |
callback(data) | |
}, 2000); | |
} |
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
const request = require('request') | |
const url = "https://api.darksky.net/forecast/fb190dafa7914f0bb56e65287631fad9/37.8267,-122.4233" | |
request({url:url,json:true}, (error,response) => { | |
if (error) { | |
console.log('Unable to connect to wheather API') | |
} else if (response.body.error){ | |
console.log('Error to connect to wheather API') |
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
//Install HTTP Request | |
// npm init -y | |
// npm i request | |
const request = require('request') | |
const url = "https://api.darksky.net/forecast/fb190dafa7914f0bb56e65287631fad9/37.8267,-122.4233" |
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
console.log('Starting') | |
setTimeout( () => { | |
console.log('2 Second Timer') | |
},2000) //2 Secondes | |
setTimeout( () => { | |
console.log('0 Second Timer') | |
},0) //2 Secondes |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>compileBitcode</key> | |
<true/> | |
<key>method</key> | |
<string>development</string> | |
<key>provisioningProfiles</key> | |
<dict> |
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
xcodebuild -scheme schemename -workspace workspacename.xcworkspace/ build | |
xcodebuild -workspace workspacename.xcworkspace -scheme scheme name -destination generic/platform=iOS build | |
xcodebuild -workspace workspacename.xcworkspace -scheme scheme name clean archive -configuration debug -sdk iphoneos -archivePath ~/Downloads/archivename.xcarchive | |
xcodebuild -exportArchive -archivePath ~/Downloads/archivename.xcarchive -exportPath ~/Downloads -exportOptionsPlist ~/Downloads/ExportOptions.plist |
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
let json = try? JSONEncoder().encode(model) |
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
extension UserInfo: Encodable { | |
func encode(to encoder: Encoder) throws { | |
var container = encoder.container(keyedBy: CodingKeys.self) | |
try container.encode(userId, forKey: .userId) | |
try container.encode(jobTitleName, forKey: .jobTitleName) | |
try container.encode(preferredFullName, forKey: .preferredFullName) | |
try container.encode(employeeCode, forKey: .employeeCode) | |
try container.encode(region, forKey: .region) | |
try container.encode(phoneNumber, forKey: .phoneNumber) |
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
let decoder = JSONDecoder() | |
let model = try? decoder.decode(User.self, from:jsonData) | |
struct Name: Codable { | |
var firstname: String | |
var lastname: String | |
} | |
struct User: Codable { | |
var userId: String |
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
{ | |
"userId": "rirani", | |
"jobTitleName": "Developer", | |
"name": { | |
"firstname": "rinto", | |
"lastname": "andrews" | |
} | |
} |