Skip to content

Instantly share code, notes, and snippets.

View JosephDuffy's full-sized avatar
🐒
Code monkey

Joseph Duffy JosephDuffy

🐒
Code monkey
View GitHub Profile
@JosephDuffy
JosephDuffy / 1. StateMachine.swift
Created August 18, 2018 19:46 — forked from shaps80/1. StateMachine.swift
A lightweight generic state machine implementation in Swift.
import Foundation
import os.log
public protocol StateMachineDelegate: class {
associatedtype StateType: Hashable
/// Invoked before a transition is about to occur, allowing you to reject even a valid transition. Defaults to true
///
/// - Parameters:
@JosephDuffy
JosephDuffy / 0_reuse_code.js
Last active August 29, 2015 14:12
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console