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 let creditCardAccount = checkingOnly.creditCardAccount { | |
print(creditCardAccount) | |
} else { | |
print("The guy has no credit card") | |
} | |
// The guy has no credit card | |
if let bothProductCreditCardAccount = bothProducts.creditCardAccount { |
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 checkingOnly = BankAccount(checkingAccount: "12345", creditCardAccount: nil) | |
let bothProducts = BankAccount(checkingAccount: "12345", creditCardAccount: "109876") |
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 checkingOnly = BankAccount(checkingAccount: "12345", creditCardAccount: nil) | |
let bothProducts = BankAccount(checkingAccount: "12345", creditCardAccount: "109876") | |
print(bothProducts.checkingAccount) | |
// 12345 | |
print(bothProducts.creditCardAccount) | |
// Optional("109876") | |
print(bothProducts.creditCardAccount!) |
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 BankAccount { | |
let checkingAccount: String | |
let creditCardAccount: String? | |
init(checkingAccount: String, creditCardAccount: String?) { | |
self.checkingAccount = checkingAccount | |
self.creditCardAccount = creditCardAccount | |
} | |
} |
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
UIImage* importedImage = [info valueForKey:UIImagePickerControllerOriginalImage]; | |
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager]; | |
[manager GET:@"https://snap-picafy.appspot.com/upload_url" parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) { | |
NSLog(@"JSON: %@", responseObject); | |
[manager POST:[responseObject valueForKey:@"uploadURL"] parameters:nil constructingBodyWithBlock:^(id<AFMultipartFormData> formData) { | |
NSData* imageData = UIImagePNGRepresentation(importedImage); | |
[formData appendPartWithFileData:imageData name:@"file" fileName:@"imageSample" mimeType:@"image/png"]; | |
} success:^(AFHTTPRequestOperation *operation, id responseObject) { | |
NSLog(@"Response: %@", responseObject); |
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
UIImage* importedImage = [info valueForKey:UIImagePickerControllerOriginalImage]; | |
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager]; | |
[manager GET:@"https://snap-picafy.appspot.com/upload_url" parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) { | |
NSLog(@"JSON: %@", responseObject); | |
[manager POST:[responseObject valueForKey:@"uploadURL"] parameters:nil constructingBodyWithBlock:^(id<AFMultipartFormData> formData) { | |
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 webapp2 | |
import jinja2 | |
import os | |
from google.appengine.ext import blobstore | |
from google.appengine.ext.webapp import blobstore_handlers | |
from models import UserPicfayAsset | |
import json | |
jinja_environment = jinja2.Environment(autoescape=True, | |
loader=jinja2.FileSystemLoader( |