Skip to content

Instantly share code, notes, and snippets.

@kongtomorrow
kongtomorrow / gist:6803313
Created October 3, 2013 01:37
compile-time generation of compile-time checked KVC key paths
#import <Foundation/Foundation.h>
#define KVCKeyPath_1(a) @"" a
#define KVCKeyPath_2(a, ...) a @"." KVCKeyPath_1(__VA_ARGS__)
#define KVCKeyPath_3(a, ...) a @"." KVCKeyPath_2(__VA_ARGS__)
#define KVCKeyPath_4(a, ...) a @"." KVCKeyPath_3(__VA_ARGS__)
#define KVCKeyPath_5(a, ...) a @"." KVCKeyPath_4(__VA_ARGS__)
#define KVCKeyPath_6(a, ...) a @"." KVCKeyPath_5(__VA_ARGS__)
#define KVCKeyPath_7(a, ...) a @"." KVCKeyPath_6(__VA_ARGS__)
@simX
simX / hidpi.txt
Created July 28, 2012 04:58
Enable HiDPI mode in Mountain Lion w/o Quartz Debug
sudo defaults write /Library/Preferences/com.apple.windowserver DisplayResolutionEnabled -bool YES;
sudo defaults delete /Library/Preferences/com.apple.windowserver DisplayResolutionDisabled;
// by the way, you need to logout and log back in for this to take effect. Or at least that's what
// Quartz Debug says. Who knows, maybe it's lying?
// P.S. Go to [Apple menu --> System Preferences --> Displays --> Display --> Scaled] after logging
// back in, and you'll see a bunch of "HiDPI" resolutions in the list to choose from.