Author: Chris Lattner
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 SymmetricKey { | |
init(string keyString: String, size: SymmetricKeySize = .bits256) throws { | |
guard var keyData = keyString.data(using: .utf8) else { | |
print("Could not create base64 encoded Data from String.") | |
throw CryptoKitError.incorrectParameterSize | |
} | |
let keySizeBytes = size.bitCount / 8 | |
keyData = keyData.subdata(in: 0..<keySizeBytes) | |
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
var isIPadOs = window.AuthenticatorAssertionResponse === undefined | |
&& window.AuthenticatorAttestationResponse === undefined | |
&& window.AuthenticatorResponse === undefined | |
&& window.Credential === undefined | |
&& window.CredentialsContainer === undefined | |
&& window.DeviceMotionEvent !== undefined | |
&& window.DeviceOrientationEvent !== undefined | |
&& navigator.maxTouchPoints === 5 | |
&& navigator.plugins.length === 0 | |
&& navigator.platform !== "iPhone"; |
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
/// | |
/// https://stackoverflow.com/a/29741007 | |
/// | |
let s = Struct() // Struct | |
withUnsafePointer(to: s) { | |
print(String(format: "%p", $0) | |
} | |
/// | |
/// http://stackoverflow.com/a/36539213/226791 |
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
//A 台北市 J 新竹縣 | |
//B 台中市 K 苗栗縣 T 屏東縣 | |
//C 基隆市 U 花蓮縣 | |
//D 台南市 M 南投縣 V 台東縣 | |
//E 高雄市 N 彰化縣 W 金門縣 | |
//F 台北縣 O 新竹市 X 澎湖縣 | |
//G 宜蘭縣 P 雲林縣 | |
//H 桃園縣 Q 嘉義縣 Z 連江縣 | |
//I 嘉義市 |
This will create a proxy server in whatever your availability zone your VPC is in. For me, that's us-east-1b
. For you, that may be something different. Steps 10+ should more or less work regardless of your provider since those steps cover the setup and configuration of TinyProxy.
- Click the Launch Instance button.
- Choose Ubuntu Server 14.04 LTS (HVM), SSD Volume Type. This isn't strictly necessary. If you choose another OS, check its documentation for how to install new packages.
- On the Choose an Instance Type screen, select t2.micro. It's Free Tier eligible.
- Click the Next: ... buttons until you reach the Configure Security Group screen.
- You may wish to reduce the amount of storage on the Add Storage screen. This is optional.
- You may wish to add a tag on the Tag Instance screen. This is also optional.
- On the Configure Security Group screen:
- Select Create a new security group.
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
i386 : iPhone Simulator | |
x86_64 : iPhone Simulator | |
arm64 : iPhone Simulator | |
iPhone1,1 : iPhone | |
iPhone1,2 : iPhone 3G | |
iPhone2,1 : iPhone 3GS | |
iPhone3,1 : iPhone 4 | |
iPhone3,2 : iPhone 4 GSM Rev A | |
iPhone3,3 : iPhone 4 CDMA | |
iPhone4,1 : iPhone 4S |