This file contains hidden or 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
{ | |
"attacks": [ | |
{ | |
"attackBonus": "strengthMod + proficiencyBonus", | |
"charId": "34HGdP9BywJezCywL", | |
"color": "q", | |
"damage": "1d8 + {strengthMod}", | |
"damageType": "slashing", | |
"enabled": true, | |
"name": "Cone of Cold", |
This file contains hidden or 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
//: Playground - noun: a place where people can play | |
import Cocoa | |
enum Result<ValueType> { | |
case ok(ValueType) | |
case error(Error) | |
} | |
protocol Validator { |
This file contains hidden or 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
//: Playground - noun: a place where people can play | |
import Cocoa | |
enum Error : ErrorType { | |
case NIY | |
} | |
protocol LangValue { | |
mutating func set(object object: LangValue, forKey key: String) throws |
This file contains hidden or 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
enum Keys: String { | |
case uniqueID = "uniqueID" | |
} | |
Keys.uniqueID |
This file contains hidden or 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
extension Array { | |
func first() -> T { | |
return self[0] | |
} | |
func last() -> T { | |
return self[self.count - 1] | |
} | |
} |
This file contains hidden or 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
struct SPerson { | |
var name: String | |
init(_ name: String) { self.name = name } | |
} | |
class CPerson { | |
var name: String | |
init(_ name: String) { self.name = name } | |
} |
This file contains hidden or 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
// playground1 contents | |
// import Foundation | |
let items = [4, 2.3] // this is of type Array<Double> | |
// playground2 contents | |
import Foundation | |
let items = [4, 2.3] // this is of type NSArray |
This file contains hidden or 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
NSDictionary *dict = @{ @"key1: @"value1", | |
@"key2: @"value2", | |
// ... | |
@"keyN: @"valueN" }; |
This file contains hidden or 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
class MyDoubleDouble : FloatLiteralConvertible { | |
var double : Double | |
init(_ value: Double) { | |
double = value * 2 | |
} | |
class func convertFromFloatLiteral(value: Double) -> MyDoubleDouble { | |
return MyDoubleDouble(value) | |
} |
This file contains hidden or 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
var json = [ | |
"stat": "ok", | |
"blogs": [ | |
"blog": [ | |
[ | |
"id" : 73, | |
"name" : "Bloxus test", | |
"needspassword" : true, | |
"url" : "http://remote.bloxus.com/" | |
], |
NewerOlder