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
extension DateComponents { | |
subscript(unit: String) -> Int { | |
get { | |
switch unit { | |
case "month": | |
return self.month! | |
case "day": | |
return self.day! | |
case "hour": | |
return self.hour! |
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 | |
# Usage: | |
# $ cd /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Templates | |
# $ bash ~/remove-boilerplate-comments-from-xcode-templates.sh | |
# Repeat for /Applications/Xcode.app/Contents/Developer/Library/Xcode/Templates | |
find -E . -type f \ | |
\( -regex '.*\.[chm]' -or -regex '.*\.swift' \) \ | |
-exec sed -i '' '1,/^$/d' '{}' ';' |