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
guard !arguments.isEmpty, | |
nums.count = arguments.count | |
else { | |
print("Usage: \(appName) <list-of-positive-integers>") | |
exit(-1) | |
} |
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
infix operator <+ {} | |
func <+ <C: RangeReplaceableCollectionType>(inout collection: C, element: C.Generator.Element) { | |
collection.append(element) | |
} | |
var array = [String]() | |
array <+ "Foo" | |
array <+ "Bar" |
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 | |
protocol myProtocol: class { | |
func dothatthing () -> Void | |
} | |
var array : [protocol<myProtocol>] = [] | |
class A : myProtocol { | |
func dothatthing() { |
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
/*** | |
* Bitmap Loader | |
* Copyright © 2013 Matthew Tole | |
* | |
* Version 2.0.2 | |
***/ | |
#include <pebble.h> | |
#include "bitmap-loader.h" |