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 Foundation | |
import PlaygroundSupport | |
PlaygroundPage.current.needsIndefiniteExecution = true | |
func authenticate () { | |
//Credentials | |
let username = "USERNAME" | |
let password = "PASSWORD" |
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
rm -rf ~/Library/Developer/Xcode/DerivedData | |
rm -rf ~/Library/Developer/Xcode/Archives | |
rm -rf ~/Library/Developer/Xcode/iOS\ DeviceSupport | |
rm -rf ~/Library/Caches/com.apple.dt.Xcode | |
xcrun simctl delete unavailable | |
brew cleanup |
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 | |
echo "Removing unavailable simulators..." | |
xcrun simctl delete unavailable | |
echo "Brew cleanup..." | |
brew cleanup | |
echo "Removing Xcode Caches..." | |
rm -rf ~/Library/Caches/com.apple.dt.Xcode |
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
static inline void func_to_cleanup(void (^*block)(void)) { | |
(*block)(); | |
} | |
#define concat(a,b) a##b | |
#define defer(deferBlock) __attribute__((cleanup(func_to_cleanup))) void (^__unused concat(defer_tmp_var, __COUNTER__))(void) = deferBlock |
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
// How to: | |
// 1. Go in the Firebase Analytics Dashboard | |
// 2. Filter iOS Platform only | |
// 3. Scroll down, select `Device` under the "What is your audience like?" widget | |
// 4. Export the CSV data (top right of the corner, there's a `...` menu with Download CSV option) | |
// 5. Open the file and select the Device model breakdown raw data | |
// 6. Replace your data with the sample data in this script | |
// 7. Run the script in a Xcode Playground | |
// 8. See the terminal output |
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 lldb | |
def __lldb_init_module(debugger, internal_dict): | |
debugger.HandleCommand('command script add -f SwiftPrinter.printer pjson') | |
def printer(debugger, command, result, internal_dict): | |
debugger.HandleCommand('p print(String(data: try! JSONSerialization.data(withJSONObject:' + command + ', options: .prettyPrinted), encoding: .utf8 )!)') |