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
// | |
// Relay.swift | |
// XjSwiftLab | |
// | |
// Created by Jason Jobe on 5/11/15. | |
// Copyright (c) 2015 Jason Jobe. All rights reserved. | |
// https://gist.github.com/wildthink/19d43871964821c4f293 | |
// | |
import Foundation |
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
// | |
// NSBlockInit.swift | |
// XjSwiftLab | |
// | |
// Created by Jason Jobe on 3/19/16. | |
// Copyright (c) 2016 Jason Jobe. All rights reserved. | |
// https://gist.github.com/wildthink/48cce4cd2f27695ebb08 | |
// | |
// Thanks to Mike Ash for his expertise and support of the community | |
// https://www.mikeash.com/pyblog/friday-qa-2015-12-25-swifty-targetaction.html |
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
// | |
// ActionTrampoline.swift | |
// Swift 3 | |
// | |
// Created by Jason Jobe on 3/17/16. | |
// Copyright © 2016 WildThink. All rights reserved. | |
// | |
// https://gist.githubusercontent.com/wildthink/677308084ab364044c76/raw/f713efca9ec6ca9b56c4405bd82ae33b1db98ec7/ActionTrampoline.swift | |
// | |
// Kudos (again) to Mike Ash! |
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
// Distilation of ideas and examples from these great contributions to the community | |
// http://stackoverflow.com/questions/24007461/how-to-enumerate-an-enum-with-string-type | |
// https://forums.developer.apple.com/thread/4404 | |
// https://www.natashatherobot.com/swift-conform-to-sequence-protocol/ | |
// https://theswiftdev.com/2017/10/12/swift-enum-all-values/ | |
import Foundation | |
public protocol EnumCollection: Hashable { | |
static func cases() -> AnySequence<Self> |
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
//-- This is an introduction to Transducers in Swift, inspired by | |
// Talk: https://www.youtube.com/watch?v=estNbh2TF3E | |
// Code: https://github.com/mbrandonw/learn-transducers-playground | |
// Updated with Swift 2 | |
/** | |
* Define a few test methods | |
*/ | |
/// REDUCER | |
func append <A> (xs: [A], x: A) -> [A] { return xs + [x] } |
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
// If you want types initializable from String literals | |
// but don't want to implement three separate initializers. | |
extension ExpressibleByUnicodeScalarLiteral where Self: ExpressibleByStringLiteral, Self.StringLiteralType == String { | |
public init(unicodeScalarLiteral value: String) { | |
self.init(stringLiteral: value) | |
} | |
} |
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
I am jason_ at onename.com |
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
#!/usr/bin/python3 | |
# By Steve Hanov, 2011. Released to the public domain. | |
# Updated 2014 to use DAWG as a mapping. | |
import sys | |
import time | |
DICTIONARY = "/usr/share/dict/words" | |
QUERY = sys.argv[1:] | |
# This class represents a node in the directed acyclic word graph (DAWG). It |
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
// | |
// Domain.swift | |
// Inspired by Eve | |
// | |
// Created by Jason Jobe on 11/26/16. | |
// Copyright © 2016 Jason Jobe. All rights reserved. | |
// https://gist.github.com/wildthink/b911a5b8e0d7dc6ef190fd8fe4f7a2ee | |
// | |
import Foundation |
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
// | |
// Relay.swift | |
// XjSwiftLab | |
// | |
// Created by Jason Jobe on 5/11/15. | |
// Copyright (c) 2015, 2016 Jason Jobe. All rights reserved. | |
// https://gist.github.com/wildthink/acfdf82c2625dc73ad6e42d399d91846 | |
// | |
/* Example usage |
OlderNewer