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
| ACTION = build | |
| AD_HOC_CODE_SIGNING_ALLOWED = NO | |
| ALTERNATE_GROUP = staff | |
| ALTERNATE_MODE = u+w,go-w,a+rX | |
| ALTERNATE_OWNER = grantdavis | |
| ALWAYS_SEARCH_USER_PATHS = NO | |
| ALWAYS_USE_SEPARATE_HEADERMAPS = YES | |
| APPLE_INTERNAL_DEVELOPER_DIR = /AppleInternal/Developer | |
| APPLE_INTERNAL_DIR = /AppleInternal | |
| APPLE_INTERNAL_DOCUMENTATION_DIR = /AppleInternal/Documentation |
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
| require 'find' | |
| require 'pp' | |
| swift_file_paths = [] | |
| Find.find('./') do |path| | |
| if path =~ /.*\.swift$/ and !path.start_with? "./Carthage" | |
| swift_file_paths << path | |
| cmd = "xcrun swift-update -sdk /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk -target arm64-apple-ios9 #{path} > convert.swift" | |
| system cmd |
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 | |
| function show_code { | |
| ERROR_LOCATION=$(grep -Ron "\[UIImage imageNamed:\s*@\"$1\"\s*\]" $PROJECT_NAME) | |
| if [[ -z $ERROR_LOCATION ]]; then | |
| ERROR_LOCATION=$(grep -Ron "UIImage(named\:\s*\"$1\"\s*)" $PROJECT_NAME) | |
| fi | |
| ERROR_LOCATION=$(echo $ERROR_LOCATION | cut -d ':' -f 1,2) | |
| echo "$ERROR_LOCATION: error: Missing imageset with name $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
| // Copyright © 2016 Envoy. All rights reserved. | |
| /* | |
| Write a Swift playground that takes an n x n grid of integers. Each integer can be either 1 or 0. | |
| The playground then outputs an n x n grid where each block indicates the number of 1's around that block, (excluding the block itself) . For Block 0 on row 0, surrounding blocks are (0,1) (1,0) and (1,1). Similary for block (1,1) all the blocks around it are to be counted as surrounding blocks. | |
| Requirements: |
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
| // Returns `URL?` | |
| public enum SocketEndPoint: String { | |
| case eventSocket = "http://nowhere.com/events" | |
| case liveSocket = "http://nowhere.com/live" | |
| public var url: URL? { | |
| return URL(string: self.rawValue) | |
| } | |
| } |
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
| /** | |
| IntExtensions.swift | |
| Convert an arbitrary length byte array into a Swift Int | |
| <https://gist.github.com/tannernelson/e720877bf7700138eb99> | |
| */ | |
| extension Int { | |
| static func fromByteArray(bytes: [UInt8]) -> Int { |
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 x: Double = 0.99043125417 | |
| var length = sizeof(Double) // -> 8 | |
| var x_data = NSData(bytes: &x, length: length) | |
| var buffer = [UInt8](count: sizeof(Double), repeatedValue: 0x00) | |
| x_data.getBytes(&buffer, length: buffer.count) | |
| print(buffer) // -> "[210, 21, 179, 226, 156, 177, 239, 63]\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
| func _convertToBytes<T>(_ value: T, withCapacity capacity: Int) -> [UInt8] { | |
| var mutableValue = value | |
| return withUnsafePointer(to: &mutableValue) { | |
| return $0.withMemoryRebound(to: UInt8.self, capacity: capacity) { | |
| return Array(UnsafeBufferPointer(start: $0, count: capacity)) | |
| } | |
| } |
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 UIKit | |
| import SystemConfiguration | |
| public let ReachabilityChangedNotification = "ReachabilityChangedNotification" | |
| class HTSDReachabiltiy: NSObject { | |
| typealias NetworkReachable = (HTSDReachabiltiy) -> () | |
| typealias NetworkUnreachable = (HTSDReachabiltiy) -> () | |
| enum NetworkStatus: CustomStringConvertible { |
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 Cocoa | |
| // Note: use of enumeration var in generic is instadeath | |
| // Note: use of static var in generic is not yet supported | |
| public protocol EnumConvertible: Hashable { | |
| init?(hashValue hash: Int) | |
| static func countMembers() -> Int | |
| static func members() -> [Self] | |
| } |