Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000
let keyWindow = UIApplication.shared.connectedScenes | |
.filter { $0.activationState == .foregroundActive } | |
.map { $0 as? UIWindowScene } | |
.compactMap { $0 } | |
.first?.windows | |
.filter { $0.isKeyWindow } | |
.first | |
// Usage e.g. | |
_ = keyWindow?.safeAreaInsets.bottom ?? 0 |
#!/usr/bin/env bash | |
# | |
# lint-devices-file | |
# Usage example: ./scripts/ios/lint-devices-file fastlane/devices.txt | |
FILE=$1 | |
TAB_COUNT=$(grep "$(printf '\t')" $FILE | wc -l) | |
NEW_LINE_COUNT=$(grep "$(printf '\n')" $FILE | wc -l) |
#!/usr/bin/env bash | |
# | |
# bump-ios-app-version | |
# Usage example: ./bump-ios-app-version minor apps/app-ios-parking/SupportingFiles/Info.plist | |
component=$1 | |
info_plist_path=$2 | |
version=$(/usr/libexec/PlistBuddy -c 'Print CFBundleShortVersionString' ${info_plist_path}) |
adb devices | grep emulator | cut -f1 | while read line; do adb -s $line emu kill; done |
Host * | |
ServerAliveInterval 600 | |
TCPKeepAlive yes | |
IPQoS=throughput |
extension UIViewController { | |
/// Traverse up the responder chain until we find a `UINavigationController`. | |
func findNavigationController() -> UINavigationController? { | |
if let nextResponder = self.next as? UINavigationController { | |
return nextResponder | |
} else if let nextResponder = self.next as? UIViewController { | |
return nextResponder.findNavigationController() | |
} else { | |
return nil |
extension Optional where Wrapped: Collection { | |
var isNilOrEmpty: Bool { | |
return self?.isEmpty ?? true | |
} | |
} | |
// MARK: - Tests | |
func testNilOrEmpty() { |
*.strings utf16 diff=localizablestrings |
Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.
$ python -m SimpleHTTPServer 8000