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
#define weakify(var) __weak typeof(var) ClosureWeak_##var = var | |
#define strongify(var) \ | |
_Pragma("clang diagnostic push") \ | |
_Pragma("clang diagnostic ignored \"-Wshadow\"") \ | |
__strong typeof(var) var = ClosureWeak_##var; \ | |
_Pragma("clang diagnostic pop") |
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
sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist | |
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.mDNSResponder.plist |
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
####################################### | |
# Syntax Coloring Map For <Arduino Library Name> | |
####################################### | |
# Class (KEYWORD1) | |
####################################### | |
MyClass KEYWORD1 | |
####################################### | |
# Methods and Functions (KEYWORD2) |
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 | |
MIN_LEVEL=40 | |
MAX_LEVEL=80 | |
CURRENT_LEVEL=`ioreg -l | grep -i capacity | tr '\n' ' | ' | awk '{printf("%d\n",$10/$5*100)}'` | |
if [ $CURRENT_LEVEL -lt $MIN_LEVEL ]; then | |
echo "Plug me back in, mate! ("$CURRENT_LEVEL"%)" | |
elif [ $CURRENT_LEVEL -gt $MAX_LEVEL ]; then |
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
// WBVirtualKeyboardManager.h | |
@interface WBVirtualKeyboardManager : NSObject | |
@property (assign, getter = shouldForceVirtualKeyboard) BOOL forceVirtualKeyboard; | |
+ (WBVirtualKeyboardManager *)sharedVirtualKeyboardManager; | |
- (void)activate; | |
- (void)deactivate; | |
@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
#ifdef __OBJC__ | |
#ifndef WBRetain | |
#if __has_feature(objc_arc) | |
# define WBRetain(obj) obj | |
#else | |
# define WBRetain(obj) [obj retain] | |
#endif | |
#endif |
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
@interface SettingsViewController : UIViewController | |
@end | |
@interface MainViewController : UIViewController | |
- (IBAction)settingsButtonTapped:(id)sender; | |
@end | |
@implementation MainViewController | |
- (IBAction)settingsButtonTapped:(id)sender | |
{ |