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 SwiftUI | |
public extension View { | |
func fillMaxSize(alignment: Alignment = .center) -> some View { | |
frame(maxWidth: .infinity, maxHeight: .infinity, alignment: alignment) | |
} | |
func fillMaxWidth(alignment: Alignment = .center) -> some View { | |
frame(maxWidth: .infinity, alignment: alignment) | |
} |
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 fs = require('fs'); | |
console.log("\n *START transformation* \n"); | |
var content = fs.readFileSync("db.json"); | |
var json = JSON.parse(content); | |
var docs = json.rows; | |
var newDocs = new Array(); | |
docs.forEach(function(doc) { | |
var innerdoc = doc.doc; | |
delete innerdoc._rev; | |
newDocs.push(innerdoc); |
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 Foundation | |
// Enter your code here | |
//print("Enter str1") | |
var str1 = Array(readLine(strippingNewline: true)!.characters) | |
//print("Enter str2") | |
var str2 = Array(readLine(strippingNewline: true)!.characters) | |
var tempDelArr = [Character]() | |
var tempIndexArr = [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
func fetchData(){ | |
UIApplication.shared.isNetworkActivityIndicatorVisible = true | |
let apiUrl = "https://raw.githubusercontent.com/javalnanda/AlamofireObjectMapperSample/master/AOMsample.json" | |
Alamofire.request(apiUrl).validate().responseArray(keyPath: "result") { (response: DataResponse<[Project]>) in | |
UIApplication.shared.isNetworkActivityIndicatorVisible = false | |
switch response.result { | |
case .success: | |
self.projects = response.result.value ?? [] | |
for project in self.projects { | |
print(project.name) |
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 Foundation | |
import ObjectMapper | |
class Project: NSObject, Mappable { | |
var projectId: Int? | |
var accountId: Int? | |
var dateCreated: Int? | |
var dateModified: Int? | |
var name: 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
{ | |
"err": 0, | |
"result": [{ | |
"id": 71930, | |
"account_id": 40869, | |
"status": "enabled", | |
"settings_data": { | |
"time_format": "12h", | |
"timezone": "US/Pacific", | |
"fingerprint_versions": { |