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
#!/bin/bash | |
# The name of the runner user account | |
RUNNER_USERNAME="runner" | |
RUNNER_FULLNAME="$RUNNER_USERNAME" | |
# Check for sudo access | |
echo "Checking for root access..." | |
# Check if running as root | |
if [ $EUID != 0 ]; then |
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
#!/bin/bash | |
# Workspace and scheme parameters for the project | |
workspace="ProjectWorkspace.xcworkspace" # TODO: Replace with your project's workspace | |
scheme="ProjectScheme" # TODO: Replace with your project's scheme | |
# The number of times to build the project | |
numRuns=3 | |
# Abort the process if any of the commands in this script fail |
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
source ~/.bash_profile | |
unset LLVM_TARGET_TRIPLE_SUFFIX | |
xcodebuild -scheme <project_name> -workspace <project_name>.xcworkspace clean | |
xcodebuild -scheme <project_name> -workspace <project_name>.xcworkspace COMPILER_INDEX_STORE_ENABLE=NO | xcpretty -r json-compilation-database --output compile_commands.json | |
maxPriority=15000 | |
oclint-json-compilation-database -exclude Pods -exclude build -- -report-type xcode -max-priority-1=$maxPriority -max-priority-2=$maxPriority -max-priority-3=$maxPriority |
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
// | |
// The code snippets below showcase common "problem code" that can take a long time to compile. | |
// These examples were primarily observed in Swift 2/3 and may no longer be relevant in Swift 4 or higher. | |
// | |
/// 1. Array concatenation | |
// Observed by Robert Gummesson - https://medium.com/@RobertGummesson/regarding-swift-build-time-optimizations-fc92cdd91e31#c75c | |
// Joining two arrays together with the '+' operator can be expensive to compile. | |
let someArray = ["a", "b"] + ["c", "d"] |
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 | |
/// Introduction | |
// This playground showcases many potential use cases of `map` and `flatMap` in Swift (beyond transforming collections). | |
// See this article on Medium for more information: https://medium.com/rocket-fuel/step-up-your-functional-game-map-and-flatmap-tricks-cdc1578fe7bc | |
// To run this playground in Xcode, copy/paste the contents of this file into a new playground (playgrounds are technically directories so GitHub Gist doesn't work well with them). | |
// There are several comment blocks that represent the "old way" of doing things (without `map`/`flatMap`). Feel free to uncomment these to verify functionality. |
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
# Name of the resource we're selectively copying | |
GOOGLESERVICE_INFO_PLIST=GoogleService-Info.plist | |
# Get references to dev and prod versions of the GoogleService-Info.plist | |
# NOTE: These should only live on the file system and should NOT be part of the target (since we'll be adding them to the target manually) | |
GOOGLESERVICE_INFO_DEV=${PROJECT_DIR}/${TARGET_NAME}/Firebase/Dev/${GOOGLESERVICE_INFO_PLIST} | |
GOOGLESERVICE_INFO_PROD=${PROJECT_DIR}/${TARGET_NAME}/Firebase/Prod/${GOOGLESERVICE_INFO_PLIST} | |
# Make sure the dev version of GoogleService-Info.plist exists | |
echo "Looking for ${GOOGLESERVICE_INFO_PLIST} in ${GOOGLESERVICE_INFO_DEV}" |
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
# | |
#### DEPRECATED #### | |
# Use the standard .swiftlint.yml for all files in your project, including tests. | |
# https://gist.github.com/tylermilner/f33e33e3b4f23d8c6b2fdd4f87af98a1 | |
# | |
# Set max line length before warning (default is 120) | |
line_length: 240 | |
disabled_rules: |
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
# Turn off default SwiftLint rules | |
disabled_rules: | |
- trailing_whitespace # Disables SwiftLint complaining about whitespace characters on empty lines | |
- todo # Disables auto-warning of TODO statements | |
# Turn on extra SwiftLint rules | |
opt_in_rules: | |
- array_init | |
- attributes | |
- closure_end_indentation |
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
All Objective-C Exceptions | |
// Catches exceptions thrown by Objective-C code. | |
// Default Xcode breakpoint created by clicking "+" to add breakpoint -> "Exception Breakpoint". | |
// Change "Exception: All" to "Exception: Objective-C". | |
-[UIApplication main] | |
// Helps when printing objects via the debugger by making it aware of the classes in UIKit. | |
// Symbolic breakpoint created by clicking "+" to add breakpoint -> "Symbolic Breakpoint". | |
// Enter "-[UIApplication main]" for the Symbol. | |
// Choose Action -> "Debugger Command". |
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
1.) Create 'api.raml' file: | |
#%RAML 1.0 | |
title: Radio Station | |
version: v1 | |
baseUri: http://api.samplehost.com | |
2.) Layout basic API structure: |