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
| /* 妄想 */ | |
| walkOutside().if() { | |
| return isNiceWeather() | |
| } else { | |
| stayAtHome() | |
| } |
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
| #!/bin/bash | |
| # usage: ./deploygate.sh path/to.ipa "This is new beta app" | |
| deploygate() { | |
| username=${DEPLOYGATE_USER:?} | |
| apikey=${DEPLOYGATE_API_TOKEN:?} | |
| pathToIpa=${1:?} | |
| message="$2" | |
| command="ipa distribute:deploygate \ | |
| --trace \ | |
| -n \ |
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
| import Darwin | |
| enum Member: Int { | |
| case Nakagawa, Otani, Mattsu, Toshi, Minami | |
| case Unknown | |
| static let count:Int = 5 | |
| static func getSomeone() -> Member { | |
| let r = Int(arc4random_uniform(10000)) | |
| let i = r % Member.count | |
| return Member(rawValue: i) ?? Member.Unknown | |
| } |
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
| import Darwin | |
| enum Member: Int { | |
| case Nakagawa, Otani, Mattsu, Toshi, Minami | |
| case Unknown | |
| static let count:Int = 5 | |
| static func getSomeone() -> Member { | |
| let r = Int(arc4random_uniform(10000)) | |
| let i = r % Member.count | |
| return Member(rawValue: i) ?? Member.Unknown | |
| } |
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
| #!/bin/bash | |
| # | |
| # name: | |
| # mkicon.sh | |
| # | |
| # description: | |
| # Generates icon images from original file | |
| # The original image should be larger than 1024x1024 in pixel | |
| # | |
| # parameters: |
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
| import Foundation | |
| // used in map5 | |
| let queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0) | |
| let group = dispatch_group_create() | |
| extension Array { | |
| func map2<U>(transform: Element ->U) -> [U] { | |
| return reduce([]) { | |
| $0 + [transform($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
| /// A pointer to an object of type `Memory`. This type provides no automated | |
| /// memory management, and therefore the user must take care to allocate | |
| /// and free memory appropriately. | |
| /// | |
| /// The pointer should be aligned to `alignof(Memory.self)`. | |
| /// | |
| /// The pointer can be in one of the following states: | |
| /// | |
| /// - memory is not allocated (for example, pointer is null, or memory has | |
| /// been deallocated previously); |
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
| import Foundation | |
| extension Array { | |
| func map7<U>(@noescape transform: Element ->U) -> [U] { | |
| var result = UnsafeMutablePointer<U>.alloc(1000) | |
| let resultBuffer = UnsafeMutableBufferPointer(start: result, count: 1000) | |
| self.withUnsafeBufferPointer { (buffer:UnsafeBufferPointer<Element>) in | |
| for element in buffer { |
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
| import Foundation | |
| extension Array { | |
| func map7<U>(@noescape transform: Element ->U) -> [U] { | |
| var result = UnsafeMutablePointer<U>.alloc(1000) | |
| let resultBuffer = UnsafeMutableBufferPointer(start: result, count: 1000) | |
| self.withUnsafeBufferPointer { (buffer:UnsafeBufferPointer<Element>) in | |
| for element in buffer { |
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
| reduce(username.dynText, dB: password.dynText, dC: passwordVerification.dynText) | |
| { user, pass, v in | |
| return [user, pass, v].reduce(true) | |
| {(v, e) in | |
| return !v ? false : e.characters.count > 0 | |
| } | |
| } ->> button.dynEnabled |