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
BOOL CGFloatEqual(CGFloat a, CGFloat b, CGFloat accuracy) | |
{ | |
#if CGFLOAT_IS_DOUBLE | |
if (fabs(a-b) < accuracy * DBL_EPSILON * fabs(a+b) || fabs(a-b) < DBL_MIN) | |
{ | |
return YES; | |
} | |
#else | |
if (fabs(a-b) < accuracy * FLT_EPSILON * fabs(a+b) || fabs(a-b) < FLT_MIN) | |
{ |
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
Untitled.m:13:11: warning: incompatible pointer to integer conversion initializing 'BOOL' (aka 'signed char') with an expression of type 'NSObject *' [-Wint-conversion] | |
BOOL objExists = obj; | |
^ ~~~ | |
1 warning generated. | |
2014-02-18 09:44:10.739 Untitled[46411:507] myBOOL != YES | |
2014-02-18 09:44:10.741 Untitled[46411:507] Starting void assignPrimitiveToBOOL() | |
2014-02-18 09:44:10.741 Untitled[46411:507] Failed with value 0 | |
2014-02-18 09:44:10.741 Untitled[46411:507] Failed with value 256 | |
2014-02-18 09:44:10.741 Untitled[46411:507] Failed with value 512 | |
2014-02-18 09:44:10.742 Untitled[46411:507] Failed with value 768 |
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 MyObject () | |
@property (nonatomic, strong) NSString *myStrongString; | |
@property (nonatomic, copy) NSString *myCopyString; | |
@end | |
@implementation MyObject | |
- (id)init |
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 DataObject : NSObject | |
// public properties | |
@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 | |
# Created by Håvard Fossli <hfossli@gmail.com> in 2013 | |
# This is free and unencumbered software released into the public domain. | |
# For more information, please refer to <http://unlicense.org/> | |
# | |
# Description | |
# A bash script for fetching all branches and tags of a git project as snapshots into separate folders | |
# | |
# Keywords |
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
- (void)viewDidLoad | |
{ | |
[super viewDidLoad]; | |
UIView *view = [[UIView alloc] initWithFrame:CGRectMake(100, 100, 300, 200)]; | |
view.backgroundColor = [UIColor blueColor]; | |
[self.view addSubview:view]; | |
[view addObserver:self forKeyPath:@"frame" options:0 context:NULL]; |
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 <Foundation/Foundation.h> | |
int main(int argc, char *argv[]) { | |
@autoreleasepool { | |
NSUInteger iterations = 1000000; | |
{ // Regex | |
NSTimeInterval timeStart = CFAbsoluteTimeGetCurrent(); | |
NSString *result = nil; |
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 <UIKit/UIKit.h> | |
@interface UIScrollView (ScrollsToTop) | |
+ (void)forceNewViewsDefaultValueForScrollsToTop; | |
+ (void)makeOnlyThisScrollViewScrollToTopOnStatusBarTap:(UIScrollView *)scrollView; | |
- (void)makeOnlyThisScrollViewScrollToTopOnStatusBarTap; | |
@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
#import <UIKit/UIKit.h> | |
extern NSString * const UIApplicationDidHideStatusBarNotification; | |
@interface IVYApplication : UIApplication | |
@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
#!/usr/bin/ruby | |
# xcode-git-commit-hash-cfbundleversion.rb | |
# Run script for Xcode to run after build / archive | |
# Updates CFBundleVersion in Info.plist file with short git commit hash | |
# | |
# This is based on | |
# http://github.com/guicocoa/xcode-git-cfbundleversion/ | |
# http://github.com/digdog/xcode-git-cfbundleversion/ | |
# http://github.com/jsallis/xcode-git-versioner | |
# http://github.com/juretta/iphone-project-tools/tree/v1.0.3 |