Go sudo
sudo su| #!/bin/bash | |
| # Put here and make executable: chmod +x .git/hooks/pre-commit | |
| git diff --diff-filter=d --staged --name-only | grep -e '\(.*\).swift$' | while read line; do | |
| swiftformat "${line}"; | |
| git add "$line"; | |
| done |
| import Foundation | |
| struct ThreadSafeVar<T> { | |
| private let _lock = NSRecursiveLock() | |
| private var _value: T | |
| var value: T { | |
| get { | |
| _lock.lock() | |
| let value = _value |
| Mac Network Commands Cheat Sheet | |
| After writing up the presentation for MacSysAdmin in Sweden, I decided to go ahead and throw these into a quick cheat sheet for anyone who’d like to have them all in one place. Good luck out there, and stay salty. | |
| Get an ip address for en0: | |
| ipconfig getifaddr en0 | |
| Same thing, but setting and echoing a variable: |