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
class Link<T> { | |
let value: T | |
let nextLink: Link<T>? | |
init(_ value: T, next: Link<T>?){ | |
self.value = value | |
self.nextLink = next | |
} | |
} |
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 contains(e: Element) -> Bool { | |
var elementFound = false | |
for item in elements { | |
if e == item { | |
elementFound = true | |
} | |
} | |
return elementFound | |
} |
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 numbers = [1, 2, 3] | |
let index = numbers.count | |
var i = 0; | |
while i < index { | |
print(numbers[i]) | |
i += 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
let numbers = 1...3 | |
for number in numbers { | |
print(number) | |
} | |
// Prints "1" | |
// Prints "2" | |
// Prints "3" |
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
Auth0 | |
.authentication().createUser(email: email, | |
username: username, | |
password: "hellogrow", | |
connection: "Username-Password-Authentication", | |
userMetadata: [:]).start { result in | |
switch result { | |
case .success( _): | |
UserAuthenticationManager.sharedInstance.username = username | |
UserAuthenticationManager.sharedInstance.email = email |
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
it("should return this week when last order over 7 days but under 13 and next order tomorrow") { | |
let thisWeek = Order.createNewEntity() as! Order | |
thisWeek.arrivalDate = NSDate().dateByAddingTimeInterval(NSDate.oneWeekInterval() + NSDate.oneDayInterval() * -1) | |
thisWeek.isAlternateWindow = false | |
let nextWeek = Order.createNewEntity() as! Order | |
nextWeek.arrivalDate = NSDate().dateByAddingTimeInterval(NSDate.oneDayInterval()) | |
nextWeek.isAlternateWindow = false | |
let futureWeek = Order.createNewEntity() as! Order |
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
{ response = { | |
songs = ({ | |
"artist_id" = ARW9QSZ1187FB4B93E; | |
"artist_name" = "George Harrison"; | |
id = SOGKRTA12AF72A065D; | |
message = "OK (match type 8)"; | |
score = 44; | |
title = "Here Comes The Sun"; | |
} | |
); |
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
{ | |
"response": { | |
"status": { | |
"version": "4.2", | |
"code": 0, | |
"message": "Success" | |
}, | |
"track": { | |
"status": "complete", | |
"song_id": "SOEUZFE12B0B809F99", |
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
{ | |
"response": { | |
"status": { | |
"version": "4.2", | |
"code": 0, | |
"message": "Success" | |
}, | |
"track": { | |
"status": "complete", | |
"analyzer_version": "3.1.3", |
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
@implementation SomeObject | |
@synthesize containedObject; | |
@end |
NewerOlder