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
UIView.animate(withDuration: time, animations: { [unowned self] in | |
// animation | |
self.animationFunction() | |
}) { [unowned self] success in | |
// non-animation function | |
self.nonAnimationFunction() | |
UIView.animate(withDuration: time, animations: { | |
// animation | |
self.animationFunction() | |
}) { success in |
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
// Escape the Pyramid of DOOM! | |
Animate(duration: time) { [unowned self] in | |
// animation | |
self.animationFunction() | |
}.do { [unowned self] in | |
// non-animation function | |
self.nonAnimationFunction() | |
}.then(duration: time) { [unowned self] in | |
// animation | |
self.animationFunction() |
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
internal class Node<T> { | |
var data: T | |
var next: Node<T>? | |
init(data: T) { | |
self.data = data | |
} | |
} | |
internal struct Queue<T> { | |
var first, last: Node<T>? |
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
typealias Animation = (TimeInterval, ()->Void) | |
let animation: Animation = (5.0, { | |
// Code to animate | |
}) | |
let animations = Queue<Animation>() | |
animations.enqueue(animation) |
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
func perform() { | |
guard let animation = animations.dequeue else { return } | |
UIView.animate(withDuration: animation.0, animations: animation.1) { success in | |
perform() | |
} | |
} |
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 | |
extension AppDelegate: CoordinatorType { | |
weak internal var delegate: CoordinatorTypeDelegate? { return nil } | |
internal var childCoordinators: [CoordinatorType] { | |
get { | |
return AppDelegate.Static.childCoordinators | |
} | |
set { |
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
// | |
// CoordinatorType.swift | |
// | |
// Created by Reid Chatham on 9/19/16. | |
// | |
#if os(macOS) | |
import Cocoa | |
public typealias MyViewController = NSViewController | |
public typealias MyTabController = NSTabViewController |
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 Foundation | |
import SwiftyJSON | |
class {{className}}: Codable { | |
{{#properties}} | |
var {{nativeName}}: {{type}} | |
{{/properties}} |
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
unbind C-b | |
set-option -g prefix C-Space | |
bind-key C-Space send-prefix | |
bind h select-pane -L | |
bind j select-pane -D | |
bind k select-pane -U | |
bind l select-pane -R | |
set-option -g mouse on |
OlderNewer