Skip to content

Instantly share code, notes, and snippets.

View nickynick's full-sized avatar

Nick Tymchenko nickynick

View GitHub Profile
@nickynick
nickynick / gist:4151e3b18e1191c5868b
Created December 15, 2014 00:00
1989 puzzle v2
0 = (1 - 9 + 8) * 9
1 = (1 * 9 - 8)^9
2 = 19 - 8 - 9
3 = (19 + 8) / 9
4 = 1 * (√9) - 8 + 9
5 = 1 + √9 - 8 + 9
6 = (1 + 9 + 8) / (√9)
7 = -1 + 9 + 8 - 9
8 = (1 - 9) / 8 + 9
9 = 1 + 9 + 8 - 9
0 = (1 - 9 + 8) * 9
1 = (1 * 9 - 8)^9
2 = 19 - 8 - 9
3 = (19 + 8) / 9
4 = 1 * (√9) - 8 + 9
5 = 1 + √9 - 8 + 9
6 = (1 + 9 + 8) / (√9)
7 = -1 + 9 + 8 - 9
8 = (1 - 9) / 8 + 9
9 = 1 + 9 + 8 - 9
#import <UIKit/UIKit.h>
@interface LayoutWrapperView : UIView
@property (nonatomic, readonly) UIView *view;
@property (nonatomic, assign) UIEdgeInsets insets;
@property (nonatomic, assign) BOOL collapsesIfViewIsNotVisible;
@nickynick
nickynick / gist:8490464
Created January 18, 2014 13:21
Alcatraz crash report
Process: Xcode [278]
Path: /Applications/Xcode.app/Contents/MacOS/Xcode
Identifier: com.apple.dt.Xcode
Version: 5.0.2 (3335.32)
Build Info: IDEApplication-3335032000000000~4
App Item ID: 497799835
App External ID: 106632651
Code Type: X86-64 (Native)
Parent Process: launchd [136]
User ID: 502
@nickynick
nickynick / Objective-C property key macro
Last active December 27, 2015 11:48
A smart macro for getting a key string for an Objective-C property. Will give you a proper compilation error if something is wrong :)
#define KEY(Class, key) ( YES ? @#key : ^{ (void)((Class *)[[Class alloc] init]).key; return @""; }() )
/*
Usage:
KEY(UIViewController, navigationItem) - returns @"navigationItem"
KEY(UIView, frame) - returns @"frame"
KEY(UIView, tag) - returns @"tag"
KEY(UIView, foobar) - compilation error!
*/