It was done on the following environment:
- Raspberry Pi 3 Model B
- OS: Ubuntu Core
- Pi is connected to internet via Ethernet
Here are the overview of the steps:
| #ifndef NOISE_SIMPLEX_FUNC | |
| #define NOISE_SIMPLEX_FUNC | |
| /* | |
| Description: | |
| Array- and textureless CgFx/HLSL 2D, 3D and 4D simplex noise functions. | |
| a.k.a. simplified and optimized Perlin noise. | |
| The functions have very good performance | |
| and no dependencies on external data. |
| // | |
| // LoadingOverlay.swift | |
| // app | |
| // | |
| // Created by Igor de Oliveira Sa on 25/03/15. | |
| // Copyright (c) 2015 Igor de Oliveira Sa. All rights reserved. | |
| // | |
| // Usage: | |
| // | |
| // # Show Overlay |
| import UIKit | |
| extension UIDevice { | |
| /// A "pretty" device name for the machine identifier. | |
| /// | |
| /// Current for devices supporting iOS 9 and later and tvOS 9 and later, as of WWDC 2019. | |
| var modelName: String { | |
| var machineString = String() | |
| var systemInfo = utsname() |
| import Foundation | |
| @dynamicMemberLookup | |
| enum JSON: Codable, CustomStringConvertible { | |
| var description: String { | |
| switch self { | |
| case .string(let string): return "\"\(string)\"" | |
| case .number(let double): | |
| if let int = Int(exactly: double) { | |
| return "\(int)" |
| class FairPlayer: AVPlayer { | |
| private let queue = DispatchQueue(label: "com.icapps.fairplay.queue") | |
| func play(asset: AVURLAsset) { | |
| // Set the resource loader delegate to this class. The `resourceLoader`'s delegate will be | |
| // triggered when FairPlay handling is required. | |
| asset.resourceLoader.setDelegate(self, queue: queue) | |
| // Load the asset in the player. |
| import Foundation | |
| extension Data { | |
| var prettyPrintedJSONString: NSString? { /// NSString gives us a nice sanitized debugDescription | |
| guard let object = try? JSONSerialization.jsonObject(with: self, options: []), | |
| let data = try? JSONSerialization.data(withJSONObject: object, options: [.prettyPrinted]), | |
| let prettyPrintedString = NSString(data: data, encoding: String.Encoding.utf8.rawValue) else { return nil } | |
| return prettyPrintedString | |
| } |
| import UIKit | |
| import AVFoundation | |
| class ViewController: UIViewController { | |
| override func viewDidAppear(_ animated: Bool) { | |
| super.viewDidAppear(animated) | |
| switch AVCaptureDevice.authorizationStatus(for: .video) { | |
| case .notDetermined: |
Also, there is some info on: http://fuckingblocksyntax.com
/// returnType (^blockName)(parameterTypes) = ^returnType(parameters) {...};
void (^printXAndY)(int) = ^(int y) {
printf("%d %d\n", x, y);
};
printXAndY(4);
| // | |
| // ExtensionURLRequest.swift | |
| // | |
| // Created by Abhishek Maurya on 16/07/20. | |
| // Copyright © 2020. All rights reserved. | |
| // | |
| import Foundation | |
| extension URLRequest { |