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
Development Phase: | |
Step 1: Create Certificate .pem from Certificate .p12 | |
Command: openssl pkcs12 -clcerts -nokeys -out apns-dev-cert.pem -in apns-dev-cert.p12 | |
Step 2: Create Key .pem from Key .p12 | |
Command : openssl pkcs12 -nocerts -out apns-dev-key.pem -in apns-dev-key.p12 | |
Step 3: Optional (If you want to remove pass phrase asked in second step) | |
Command : openssl rsa -in apns-dev-key.pem -out apns-dev-key-noenc.pem |
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
RACSignal * signal1 = [[RACSignal return:@1] delay:1]; | |
RACSignal * signal2 = [[RACSignal return:@2] delay:1]; | |
RACSignal * signal3 = [[[RACSignal return:@3] delay:3] doNext:^(id x) { | |
NSLog(@"complete signal 3"); | |
}]; | |
RACSignal * signal4 = [[RACSignal return:@4] delay:1]; | |
RACSignal * signal5 = [[RACSignal return:@5] delay:1]; | |
// требуется сделать 2 сигнала паралельно, потом 1 последовательно, 2 паралельно | |
RACSignal *signal6 = [[RACSignal zip:@[signal1, signal2]] doNext:^(id x) { |
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
for pid in `pidof java`; do echo "$(< /proc/$pid/cmdline)"; egrep 'files|Limit' /proc/$pid/limits; echo "Currently open files: $(ls -1 /proc/$pid/fd | wc -l)"; echo; done |
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
class LoginViewController: UIViewController { | |
struct ViewModel { | |
let email: String | |
let password: String | |
let error: String | |
let isLoading: Bool | |
let login: () -> Void | |
} | |
private let activityIndicator = UIActivityIndicatorView() |
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
class LoginViewController: UIViewController { | |
struct ViewModel { | |
enum Status { | |
case inProgress | |
case failed(String, login: Command) | |
case login(Command) | |
} | |
let email: String | |
let password: String | |
let status: Status |
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
class GoodsListViewController: UIViewController { | |
struct Goods {} | |
private var items: [Goods] = [] | |
private let tableView: UITableView = UITableView(frame: .zero, style: .grouped) | |
func update(goods: [Goods]) { | |
items = goods | |
tableView.reloadData() | |
} |
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
class GoodsListViewController: UIViewController { | |
struct ViewModel { | |
struct Goods {} | |
let prev: [Goods] | |
let current: Goods | |
let next: [Goods] | |
} | |
private var items: [ViewModel.Goods] = [] | |
private let tableView: UITableView = UITableView(frame: .zero, style: .grouped) |
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
-- Get Max ID from table | |
SELECT MAX(id) FROM table; | |
-- Get Next ID from table | |
SELECT nextval('table_id_seq'); | |
-- Set Next ID Value to MAX ID | |
SELECT setval('table_id_seq', (SELECT MAX(id) FROM table)); |
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
#!/bin/sh | |
# Должны быть установлены: | |
# brew (установить можно через скрипт /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)") | |
# brew install openconnect | |
# brew install oath-toolkit | |
# сохранить скрипт в файл vpn.sh | |
# перед запуском делаем chmod +x vpn.sh | |
# запускаем sudo vpn.sh |
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
val scalacOptions = Seq( | |
"-encoding", | |
"utf-8", // Specify character encoding used by source files. | |
"-Ybackend-parallelism", // | |
"8", | |
"-explaintypes", // Explain type errors in more detail. | |
"-feature", // Emit warning and location for usages of features that should be imported explicitly. | |
"-unchecked", // Enable additional warnings where generated code depends on assumptions. | |
"-Xcheckinit", // Wrap field accessors to throw an exception on uninitialized access. | |
// "-Ymacro-annotations", // Enable support for macro annotations, formerly in macro paradise. |
OlderNewer