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 SceneDelegate: UIResponder, UIWindowSceneDelegate { | |
var window: UIWindow? | |
func scene(_ scene: UIScene, | |
willConnectTo session: UISceneSession, | |
options connectionOptions: UIScene.ConnectionOptions) { | |
// Get UIWindowScene | |
guard let windowScene = (scene as? UIWindowScene) else { | |
return |
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
Serial Keys: | |
FU512-2DG1H-M85QZ-U7Z5T-PY8ZD | |
CU3MA-2LG1N-48EGQ-9GNGZ-QG0UD | |
GV7N2-DQZ00-4897Y-27ZNX-NV0TD | |
YZ718-4REEQ-08DHQ-JNYQC-ZQRD0 | |
GZ3N0-6CX0L-H80UP-FPM59-NKAD4 | |
YY31H-6EYEJ-480VZ-VXXZC-QF2E0 | |
ZG51K-25FE1-H81ZP-95XGT-WV2C0 | |
VG30H-2AX11-H88FQ-CQXGZ-M6AY4 |
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
[ | |
{ | |
"USD" : { | |
"symbol" : "$", | |
"name" : "US Dollar", | |
"symbol_native" : "$", | |
"decimal_digits" : 2, | |
"rounding" : 0, | |
"code" : "USD", | |
"name_plural" : "US dollars" |
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 CoreImage | |
static func createQR(fromString: String) -> CIImage? | |
{ | |
let stringData = fromString.data(using: .utf8) | |
let filter = CIFilter(name: "CIQRCodeGenerator") | |
filter?.setValue(stringData, forKey: "inputMessage") | |
filter?.setValue("H", forKey: "inputCorrectionLevel") | |
let qrCodeImage = filter?.outputImage | |
let imageByTransform = qrCodeImage?.transformed(by: CGAffineTransform(scaleX: 15.0, y: 15.0)) |
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
//: # Swift 3: Base64 encoding and decoding | |
import Foundation | |
extension String { | |
//: ### Base64 encoding a string | |
func base64Encoded() -> String? { | |
if let data = self.data(using: .utf8) { | |
return data.base64EncodedString() | |
} | |
return nil |
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
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key | |
# Don't add passphrase | |
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub | |
cat jwtRS256.key | |
cat jwtRS256.key.pub |
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 UIKit | |
import AVFoundation | |
class RecordSoundsViewController: UIViewController, AVAudioRecorderDelegate { | |
var audioPlayer: AVAudioPlayer | |
@IBAction func recordAudio(sender: UIButton) { | |
let dirPath = NSSearchPathForDirectoriesInDomains(.DocumentDirectory, .UserDomainMask, true)[0] as? String | |
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
/* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ | |
/* */ | |
/* Simple node js module to get distance between two coordinates. */ | |
/* */ | |
/* Code transformed from Chris Veness example code - please refer to his website for licensing */ | |
/* questions. */ | |
/* */ | |
/* */ | |
/* Latitude/longitude spherical geodesy formulae & scripts (c) Chris Veness 2002-2011 */ | |
/* - www.movable-type.co.uk/scripts/latlong.html */ |