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
| import Foundation | |
| import PlaygroundSupport | |
| PlaygroundPage.current.needsIndefiniteExecution = true | |
| URLCache.shared = URLCache(memoryCapacity: 0, diskCapacity: 0, diskPath: nil) | |
| func testSpeed(completion: ((Float?) -> Void)?) { | |
| guard let url = URL(string: "http://ipv4.download.thinkbroadband.com/5MB.zip") else { | |
| completion?(nil) | |
| return |
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
| let cookieStorage = HTTPCookieStorage.shared | |
| if let url = URL(string: Settings.apiURL), let cookies = cookieStorage.cookies(for: url) { | |
| for cookie in cookies { | |
| cookieStorage.deleteCookie(cookie) | |
| } | |
| } |
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
| def g(n): | |
| n+=1 | |
| while`n`[::-1]!=`n`or any(n%j<1 for j in range(2,n)):n+=1 | |
| return n |
NewerOlder