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
from Crypto.PublicKey import RSA | |
# pem = open('private.pem','r').read() | |
# key = RSA.importKey(pem) | |
# cyphertext = open('message.bin','r').read() | |
# print key.decrypt(cyphertext) | |
def gcd(a,b): |
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
extension UIAlertController { | |
func addActions(_ actions: [UIAlertAction]) { | |
for action in actions { | |
self.addAction(action) | |
} | |
} | |
} |
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
// | |
// ImageCache.swift | |
// | |
// Created by Alec O'Connor on 3/6/18. | |
// Copyright © 2018 Alec O'Connor. All rights reserved. | |
// | |
import UIKit | |
class ImageCache { |
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
extension URL { | |
/// Initializes with a String and can provide automatic URL encoding | |
/// | |
/// Returns nil if a URL cannot be formed with the string (for example, if the string contains characters that are illegal in a URL that could not be encoded, or is an empty string). | |
init?(_ string: String, provideURLEncoding: Bool) { | |
guard provideURLEncoding else { | |
guard let url = URL(string: string) else { return nil } | |
self = url | |
return |