This manual is about setting up an automatic deploy workflow using nodejs, PM2, nginx and GitLab CI. It is tested on:
- Target server: Ubuntu 16.04 x64. This is suitable for Ubuntu 14.x.
- Windows 10 on my PC to work.
| """ Use Apple's Vision Framework via PyObjC to detect text in images | |
| To use: | |
| python3 -m pip install pyobjc-core pyobjc-framework-Quartz pyobjc-framework-Vision wurlitzer | |
| """ | |
| import pathlib |
| func testNotifications() { | |
| // map all authorizationStatus with expected Result | |
| let authorizationStatusMap: [UNAuthorizationStatus: Int] = [.authorized: 1, .denied: 0, .notDetermined: 0, .provisional: 1] | |
| UNNotificationSettings.swizzleAuthorizationStatus() | |
| authorizationStatusMap.forEach { (key: UNAuthorizationStatus, value: Int) in | |
| UNNotificationSettings.fakeAuthorizationStatus = key | |
| let mockCenter = UserNotificationCenterMock() | |
| let mockCoder = MockNSCoder() |
| Update (2022): https://gist.github.com/atyachin/2f7c6054c4cd6945397165a23623987d | |
| Steps for installing the Android Emulator from EC2 console: | |
| ----------------------------------------------------------- | |
| sudo apt install default-jdk | |
| wget https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip | |
| unzip sdk-tools-linux-4333796.zip -d android-sdk | |
| sudo mv android-sdk /opt/ | |
| export ANDROID_SDK_ROOT=/opt/android-sdk |
| == Adb Server | |
| adb kill-server | |
| adb start-server | |
| == Adb Reboot | |
| adb reboot | |
| adb reboot recovery | |
| adb reboot-bootloader | |
| == Shell |
apt-get install python-pip
pip install shadowsocks
sudo ssserver -p 443 -k password -m aes-256-cfb --user nobody -d start| # Switch xcrun to leverage Xcode 7 | |
| # Note: This won't be needed once Xcode 7 is released | |
| # and becomes the primary Xcode in use. | |
| export DEVELOPER_DIR=/Applications/Xcode-beta.app/Contents/Developer/ | |
| # Export Archive | |
| xcrun xcodebuild -exportArchive -exportOptionsPlist exportPlist.plist -archivePath /path/to/app.xcarchive -exportPath /path/to/app.ipa |
| typealias UIAlertActionHandler = ((UIAlertAction) -> Swift.Void)? | |
| private struct AssociatedKeys { | |
| static var handler = "cc_handler" | |
| } | |
| private let swizzling: (UIAlertAction.Type) -> () = { action in | |
| // in swift this looks like an init, but in obj-c it's really actionWithTitle:style:handler class method | |
| let originalSelector = #selector(UIAlertAction.init(title:style:handler:)) | |
| let swizzledSelector = #selector(UIAlertAction.action(testTitle:style:handler:)) // so swizzling an init won't work. we have to use another class method | |
| std = "max" | |
| files['.luacheckrc'].global = false | |
| unused_args = false | |
| globals = { | |
| "sys", | |
| "go", | |
| "gui", | |
| "label", | |
| "render", |