I hereby claim:
- I am seancatkinson on github.
- I am seancatkinson (https://keybase.io/seancatkinson) on keybase.
- I have a public key ASBFkOOrBhVv6ThU9jwirMKcV9_lQDmQUy07V-i5rlSX1Qo
To claim this, I am signing this object:
//: Playground - noun: a place where people can play | |
import Foundation | |
// protocol representing the individual components to be matched against a URL | |
protocol URLComponentMatching { | |
func matches(_ url:URL) -> Bool | |
} | |
// logic for comparing arrays of patterns against a URL |
//: Playground - noun: a place where people can play | |
import Foundation | |
// function to do implicit and explicit compare of a value to a pattern | |
func equalIfPresent<ComparedType>(pattern:ComparedType?, value:ComparedType?) -> Bool where ComparedType:Equatable { | |
// we need a pattern else there is nothing to match against | |
// if we don't have a pattern to compare to, it implicitly matches | |
guard let pattern = pattern else { return true } |
I hereby claim:
To claim this, I am signing this object:
#pragma mark - Public Methods | |
+ (NSData*) valueForQuery:(NSDictionary*)query error:(NSError**)error { | |
// adjust the query so that we return a single data result | |
NSMutableDictionary *mutableQuery = [query mutableCopy]; | |
[mutableQuery setObject:@YES | |
forKey:(__bridge id)kSecReturnData]; | |
[mutableQuery setObject:(__bridge id)kSecMatchLimitOne | |
forKey:(__bridge id)kSecMatchLimit]; |
protocol Foo { | |
associatedtype Bar | |
func process(bar:Bar) | |
} | |
class MyFoo<T>: Foo { | |
func process(bar: T) {} | |
} |
disabled_rules: # rule identifiers to exclude from running | |
opt_in_rules: | |
- attributes | |
- closure_end_indentation | |
- closure_spacing | |
- conditional_returns_on_newline | |
- empty_count | |
- explicit_init | |
#- explicit_top_level_acl # enable this in libraries only, not in applications |
# --------------------------------------------------------------------------- | |
# | |
# Description: This file holds all my BASH configurations and aliases | |
# | |
# Sections: | |
# 1. Environment Configuration | |
# 2. Make Terminal Better (remapping defaults and adding functionality) | |
# 3. File and Folder Management | |
# 4. Searching | |
# 5. Process Management |
// Who let the dogs out? | |
enum Result <Value, Error:ErrorType> { | |
case Success(Value) | |
case Failure(Error) | |
} | |
enum DogReleasingError : ErrorType { | |
case LockedDoor | |
case NoDogs | |
case Other(reason:String) |
/** | |
A generic function that swaps to values of the same type | |
- parameter a: the value to placed in variable b | |
- parameter b: the value to be placed in variabe a | |
*/ | |
func swapTwoValues <T>(inout a:T, inout _ b:T) { | |
let temp = a | |
a = b |
// Protocols | |
protocol Speaking { | |
func speak() -> String | |
} | |
protocol Hunting { | |
func hunt() | |
} | |
protocol Foraging { |