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
<?php | |
require_once 'vendor/autoload.php'; | |
use Jose\Factory\JWKFactory; | |
use Jose\Factory\JWSFactory; | |
$key_file = 'key.p8'; | |
$secret = null; // If the key is encrypted, the secret must be set in this variable | |
$private_key = JWKFactory::createFromKeyFile($key_file, $secret, [ |
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
func tableView(tableView: UITableView, editActionsForRowAtIndexPath indexPath: NSIndexPath) -> [AnyObject]? { | |
var deleteAction = UITableViewRowAction(style: .Normal, title: " ") { [weak self] action, indexPath -> Void in | |
self?.deleteItemAtIndexPath(indexPath) | |
} | |
let cellBounds = tableView.cellForRowAtIndexPath(indexPath)!.bounds | |
UIGraphicsBeginImageContextWithOptions(cellBounds.size, true, UIScreen.mainScreen().scale) | |
var image = UIImage(named: "icon-delete-bin-white") | |
let yPos = floor((cellBounds.height / 2) - (image!.size.height / 2)) |
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
func connection(connection: NSURLConnection, canAuthenticateAgainstProtectionSpace protectionSpace: NSURLProtectionSpace?) -> Bool | |
{ | |
return protectionSpace?.authenticationMethod == NSURLAuthenticationMethodServerTrust | |
} | |
func connection(connection: NSURLConnection, didReceiveAuthenticationChallenge challenge: NSURLAuthenticationChallenge?) | |
{ | |
if challenge?.protectionSpace.authenticationMethod == NSURLAuthenticationMethodServerTrust | |
{ | |
if challenge?.protectionSpace.host == "www.myhost.com" |