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
| // Let's define a basic Swift class. | |
| class Fruit { | |
| var type=1 | |
| var name="Apple" | |
| var delicious=true | |
| } | |
| // We can get at some info about an instance of an object using reflect(), which returns a Mirror. | |
| reflect(Fruit()).count | |
| reflect(Fruit())[1].0 |
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
| #!/usr/bin/env ruby | |
| require 'rubygems' | |
| require 'date' | |
| require 'json' | |
| input = JSON.parse(ARGF.read) | |
| output = { 'meta' => { 'timestamp' => DateTime.now.strftime('%Y-%m-%d %H:%M:%S.%6N') } } | |
| symbols = {} |
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
| protocol Calendar { | |
| typealias Unit: BidirectionalIndexType | |
| typealias Era: Unit | |
| typealias Year: Unit | |
| typealias Month: Unit | |
| typealias Week: Unit | |
| typealias Day: Unit | |
| typealias Weekday: Unit | |
| typealias Hour: Unit |
OlderNewer