- Find
SystemCodeSnippets.codesnippets
file. For Xcode8:
/Applications/Xcode.app/Contents/Frameworks/IDEKit.framework/Resources/SystemCodeSnippets.codesnippets
- Make save copy of snippets
cp SystemCodeSnippets.codesnippets ~/Desktop/
- Open in vim:
sudo vim SystemCodeSnippets.codesnippets
- Move every open bracket on new line
:%s/ {/\r{/g
- Save and close
:wq
- Restart Xcode
- ????
- PROFIT!
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 | |
# Script configuration | |
devicesArray=( | |
"iPhone 8" | |
"iPhone 8 Plus" | |
"iPhone 5s" | |
"iPhone X") |
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
lane :bluepill do | |
scan(scheme: “myApp”, build_for_testing: true) | |
sh “bash ./bluepill.sh“ | |
end |
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 | |
xcrun simctl delete $(xcrun simctl list | grep -o '[0-9A-F]\{8\}-[0-9A-F]\{4\}-[0-9A-F]\{4\}-[0-9A-F]\{4\}-[0-9A-F]\{12\}' | xargs) | |
xcrun simctl delete unavailable |
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 | |
XIBS="*.xib | |
app/*.xib | |
interfaces/*.xib | |
resources/*.xib" | |
for i in $XIBS | |
do | |
echo "Compiling `basename $i`..." | |
ibtool --compile resources/`basename -s .xib $i`.nib $i |
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
/// `ObjectBinding` used as a way to create a `Binding` from a `BindableObject`. In this case the ViewModel | |
/// complies with `BindableObject` which is then translated into a `Binding` which is what `Toggle` is expecting | |
/// NOTE: Since it's a `DynamicViewProperty`, after its value is changed, the body will be updated. | |
class ViewModel: BindableObject { | |
let didChange = PassthroughSubject<ViewModel, Never>() | |
var isEnabled = false { | |
didSet { | |
didChange.send(self) |
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
T@"<NSTouchBarCustomizationCursorManagerDelegate>",W,V_delegate | |
T@"<NSTouchBarPressAndHoldTransposerDelegate>",W,V_delegate | |
T@"NSTouchBarItem",&,V_touchBarItem | |
NSTouchBarLogOnTouches | |
NSTouchBarViewObservationContext | |
T@"NSTouchBarViewController",R,V_applicationTouchBarViewController | |
T@"NSTouchBarCustomizationController",R | |
T@"NSTouchBarCustomizationPreviewItemContainerView",R | |
/Library/Caches/com.apple.xbs/Sources/AppKit/AppKit-1504.60/TouchBar.subproj/NSTouchBarCustomizationPreviewCollectionViewItem.m | |
T@"NSTouchBar",& |
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 Cocoa | |
extension String { | |
// https://stackoverflow.com/a/36258684/2227743 | |
var containsEmoji: Bool { | |
for scalar in self.unicodeScalars { | |
switch scalar.value { | |
case 0x1F600...0x1F64F, // Emoticons | |
0x1F300...0x1F5FF, // Misc Symbols and Pictographs |
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
# === Terminal.app === # | |
# Open new tab in terminal. | |
exec("osascript -e 'tell application \"System Events\" to tell process \"Terminal\" to keystroke \"t\" using command down' > /dev/null 2>&1 ") | |
# Open directory | |
exec("osascript -e 'tell application \"Terminal\" to do script \"cd directory\" in selected tab of the front window' > /dev/null 2>&1 ") | |
# Open directory in new tab (this is better) | |
exec("osascript -e 'tell application \"Terminal\"' -e 'tell application \"System Events\" to tell process \"Terminal\" to keystroke \"t\" using command down' -e 'do script with command \"cd directory && clear\" in selected tab of the front window' -e 'end tell' > /dev/null 2>&1") |
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 | |
xcrun simctl delete $(xcrun simctl list | grep -o '[0-9A-F]\{8\}-[0-9A-F]\{4\}-[0-9A-F]\{4\}-[0-9A-F]\{4\}-[0-9A-F]\{12\}' | xargs) | |
xcrun simctl delete unavailable | |
runtime="com.apple.CoreSimulator.SimRuntime.iOS-12-2" | |
xcrun simctl create "1. Monday (X)" com.apple.CoreSimulator.SimDeviceType.iPhone-X $runtime | |
xcrun simctl create "2. Tuesday (Air 2)" com.apple.CoreSimulator.SimDeviceType.iPad-Air-2 $runtime | |
xcrun simctl create "3. Wednesday (8)" com.apple.CoreSimulator.SimDeviceType.iPhone-8 $runtime | |
xcrun simctl create "4. Thursday (8 Plus)" com.apple.CoreSimulator.SimDeviceType.iPhone-8-Plus $runtime | |
xcrun simctl create "5. Friday (SE)" com.apple.CoreSimulator.SimDeviceType.iPhone-SE $runtime |
OlderNewer