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 Stack { | |
typealias Element = Int | |
private var storage: [Element] = [] | |
private var minimumList: [Element] = [] | |
func push(item: Element) { | |
let minOfCurrentAndLast = min(item, minimum() ?? item) | |
minimumList.append(minOfCurrentAndLast) |
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
// | |
// ViewController.swift | |
// ProductName | |
// | |
// Created by Marat S. on 13/08/2016. | |
// Copyright © 2016 m4rr. All rights reserved. | |
// | |
import UIKit |
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
disabled_rules: | |
- force_cast | |
- function_body_length | |
# - trailing_newline | |
# - opening_brace | |
# - empty_count | |
# - comma | |
# - colon | |
# - type_name | |
# - variable_name_min_length |
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
# Use like `gpr feature/IOS-314` - a branch from PR, | |
# this will checkout to a branch and un-commit all changes. | |
# Then open Xcode ⌥⌘C to see what's changed. | |
gpr() { | |
git checkout develop | |
git pull | |
git branch -D "$1" | |
git checkout "$1" | |
git reset --soft $(merge-base develop $(git rev-parse --abbrev-ref HEAD)) |
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
private func shakeFieldsAsError() { | |
errorFeedback() | |
[emailTextField, passwordTextField] | |
.enumerated() | |
.forEach { (index: Int, element: UITextField?) in | |
let c = element!.center | |
let ti = TimeInterval(index) * 0.05 // every next field is delayed from previous on 0.05 secs | |
let dur: Double = 0.25 |
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 | |
@available(iOS 10.0, *) | |
private var _generator: UISelectionFeedbackGenerator? | |
class SelectionFeedbackGenerator { | |
init() { | |
if #available(iOS 10, *) { | |
_generator = UISelectionFeedbackGenerator() |
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 Foundation.NSFileHandle | |
import Darwin.C.stdlib | |
do { | |
let payload = CommandLine.arguments.dropFirst() | |
let task = try EventTask.create(fromOrdered: Array(payload)) | |
let calendar = CalendarController() | |
try calendar.create(event: task) | |
} catch { |
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
lane :pack do | |
gym(scheme: "myapp", silent: true) | |
puts %x( upx ../myapp ) | |
end |
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
jobs: | |
# ... | |
make_build: | |
macos: | |
xcode: "9.2.0" | |
steps: | |
- checkout | |
# ... | |
- run: | |
name: decode Certificates |
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
platform :ios do | |
before_all do | |
setup_circle_ci | |
import_certificate( | |
keychain_name: ENV["MATCH_KEYCHAIN_NAME"], | |
keychain_password: ENV["MATCH_KEYCHAIN_PASSWORD"], | |
certificate_path: 'Certificates.p12', | |
certificate_password: ENV["CERTIFICATE_PASSWORD"] || "default" | |
) |
OlderNewer