Skip to content

Instantly share code, notes, and snippets.

View blinker13's full-sized avatar
๐ŸŒˆ

Felix Gabel blinker13

๐ŸŒˆ
View GitHub Profile
@blinker13
blinker13 / .gitignore
Created October 14, 2013 22:21
.gitignore for Xcode 5
# Xcode
.DS_Store
xcuserdata
*.xccheckout
@blinker13
blinker13 / Dock Autohide Delay
Last active December 17, 2015 07:49
Remove and restore the Dock's display delay
defaults write com.apple.Dock autohide-delay -float 0 && killall Dock
defaults delete com.apple.Dock autohide-delay && killall Dock
@blinker13
blinker13 / Singleton
Last active December 15, 2015 22:19
Class method for creating and retrieving a unique instance.
+ (instancetype)sharedInstance {
static dispatch_once_t onceToken;
static id sharedInstance;
dispatch_once(&onceToken, ^{
sharedInstance = [[self alloc] init];
});
return sharedInstance;
}
@blinker13
blinker13 / OSPlatform
Last active December 15, 2015 22:19
Macros to differentiate between the Mac OS and iOS platform and between simulator and actual device on iOS
#define MAC_PLATFORM (TARGET_OS_MAC && !TARGET_OS_IPHONE)
#define IOS_PLATFORM (TARGET_OS_MAC && TARGET_OS_IPHONE)
#define IOS_DEVICE (IOS_PLATFORM && TARGET_OS_EMBEDDED)
#define IOS_SIMULATOR (IOS_PLATFORM && TARGET_IPHONE_SIMULATOR)