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
extension Collection { | |
/// Returns the element at the specified index if it is within bounds, otherwise nil. | |
subscript (safe index: Index) -> Element? { | |
return indices.contains(index) ? self[index] : nil | |
} | |
} |
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
# This script will output the accumulated time you've spend building projects on Xcode within the current day. | |
# | |
# Output looks like: | |
# ********* | |
# You've spent 27min 24s building <your-project-name>.xcworkspace today | |
# | |
# | |
# To use it: | |
# 1. Follow the installation process from https://github.com/PaulTaykalo/xcode-time-tracker | |
# 2. Copy this script to `~/.timecheck` folder. |
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
cp -r /Applications/Xcode-beta.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/11.0\ \(15A5278f\) /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/DeviceSupport/11.0\ \(15A5278f\) | |
# Make sure you have Xcode 9 Beta 1 in /Applications/Xcode-beta.app | |
# Make sure you have Xcode 8.3.X in /Applications/Xcode.app | |
# Whenever there's a new update on Xcode 9 &/| iOS 11, you'll need to do this again using the new DeviceSupport folder |
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
# | |
# This fix should solve most of the problems with SourceKit (Not only with Swift, also with Obj-C). Such as: | |
# - Not having autocompletion | |
# - False errors | |
# | |
# This is just a temporal fix. The problem could eventually return. | |
# If that happens, just re-run this file | |
# | |
# The implementation comes from an answer in stackoverflow, which helped me a lot. | |
# |