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
// Configuration settings file format documentation can be found at: | |
// https://help.apple.com/xcode/#/dev745c5c974 | |
SUPPORTED_PLATFORMS = iphoneos macosx appletvos watchos iphonesimulator appletvsimulator watchsimulator | |
SWIFT_VERSION = 4.2 | |
IPHONEOS_DEPLOYMENT_TARGET = 9.0 | |
MACOSX_DEPLOYMENT_TARGET = 10.11 |
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
secrets/ |
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
#!/usr/bin/env bash | |
# Put this file in /usr/local/bin and then run chmod +x on it to make it executable | |
command=$1 | |
shift | |
case $command in | |
"init" ) | |
swift package init "$@" |
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
// swift-tools-version:4.0 | |
// The swift-tools-version declares the minimum version of Swift required to build this package. | |
import PackageDescription | |
let package = Package( | |
name: "appstore-screens", | |
dependencies: [ | |
// Dependencies declare other packages that this package depends on. | |
// .package(url: /* package url */, from: "1.0.0"), |
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 | |
/// A validation rule for text input. | |
public enum TextValidationRule { | |
/// Any input is valid, including an empty string. | |
case noRestriction | |
/// The input must not be empty. | |
case nonEmpty | |
/// The enitre input must match a regular expression. A matching substring is not enough. | |
case regularExpression(NSRegularExpression) |
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
class ExceptionTestCase: XCTestCase { | |
func raisesException() { | |
var exception = NSException(name: NSInternalInconsistencyException, reason: "Testing exceptions", userInfo: nil) | |
XCTAssertThrows({ exception.raise() }) | |
XCTAssertThrowsSpecific({ exception.raise() }, NSInternalInconsistencyException, "Should raise NSInternalInconsistencyException") | |
} | |
} |
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
simulatorsIdentifiers=$(instruments -s devices | | |
grep -o "iPhone .* (.*) \[.*\]" | #only iPhone | |
grep -o "\[.*\]" | #only UUID | |
sed "s/^\[\(.*\)\]$/\1/" | #remove square brackets | |
sed 's/^/"/;$!s/$/"/;$s/$/"/' | #add quotes | |
sed '$!s/$/,/' #add comma to separate each element | |
) | |
arrayOfSimulatorsIdentifiers=($(echo "$simulatorsIdentifiers" | tr ',' '\n')) |
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
command script import ~/pblock.py |
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 Darwin | |
@dynamicMemberLookup | |
struct Environment { | |
subscript(dynamicMember name: String) -> String? { | |
get { | |
guard let value = getenv(name) else { return nil } | |
return String(validatingUTF8: value) | |
} |
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
git config --global alias.trim '!f() { git branch | grep -v "\*" | xargs -n 1 git branch -D; }; f' |