Skip to content

Instantly share code, notes, and snippets.

Reid Chatham rchatham

Block or report user

Report or block rchatham

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
rchatham /
Created Jul 22, 2019 — forked from ygotthilf/
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out
cat jwtRS256.key
View CoordinatorType-CrossPlatform.swift
// CoordinatorType.swift
// Created by Reid Chatham on 9/19/16.
#if os(macOS)
import Cocoa
public typealias MyViewController = NSViewController
public typealias MyTabController = NSTabViewController
View AppDelegate+CoordinatorType.swift
import UIKit
extension AppDelegate: CoordinatorType {
weak internal var delegate: CoordinatorTypeDelegate? { return nil }
internal var childCoordinators: [CoordinatorType] {
get {
return AppDelegate.Static.childCoordinators
set {
rchatham / dequeue-animations.swift
Last active Dec 6, 2016
Performing Queued animations
View dequeue-animations.swift
func perform() {
guard let animation = animations.dequeue else { return }
UIView.animate(withDuration: animation.0, animations: animation.1) { success in
View enqueue-animations.swift
typealias Animation = (TimeInterval, ()->Void)
let animation: Animation = (5.0, {
// Code to animate
let animations = Queue<Animation>()
rchatham / queue.swift
Created Dec 6, 2016
Queue using Node's in Swift
View queue.swift
internal class Node<T> {
var data: T
var next: Node<T>?
init(data: T) { = data
internal struct Queue<T> {
var first, last: Node<T>?
rchatham / animations-with-SwiftyAnimate.swift
Created Dec 6, 2016
Chaining animations with SwiftyAnimate
View animations-with-SwiftyAnimate.swift
// Escape the Pyramid of DOOM!
Animate(duration: time) { [unowned self] in
// animation
}.do { [unowned self] in
// non-animation function
}.then(duration: time) { [unowned self] in
// animation
rchatham / pyramid-of-DOOM.swift
Created Dec 6, 2016
Chaining UIView animations
View pyramid-of-DOOM.swift
UIView.animate(withDuration: time, animations: { [unowned self] in
// animation
}) { [unowned self] success in
// non-animation function
UIView.animate(withDuration: time, animations: {
// animation
}) { success in
You can’t perform that action at this time.