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
/* | |
* Adds the serialNumber property to the UIDevice class | |
* | |
* The implementation uses undocumented (for iOS) IOKit functions, | |
* so handle with caution and be prepared for nil. | |
*/ | |
#import <UIKit/UIDevice.h> | |
@interface UIDevice (serialNumber) |
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 | |
# https://gist.github.com/949831 | |
# http://blog.carbonfive.com/2011/05/04/automated-ad-hoc-builds-using-xcode-4/ | |
# command line OTA distribution references and examples | |
# http://nachbaur.com/blog/how-to-automate-your-iphone-app-builds-with-hudson | |
# http://nachbaur.com/blog/building-ios-apps-for-over-the-air-adhoc-distribution | |
# http://blog.octo.com/en/automating-over-the-air-deployment-for-iphone/ | |
# http://www.neat.io/posts/2010/10/27/automated-ota-ios-app-distribution.html |
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
- (NSString*)getOrdinalSuffix: (int)number { | |
NSArray *suffixLookup = [NSArray arrayWithObjects:@"th",@"st",@"nd",@"rd",@"th",@"th",@"th",@"th",@"th",@"th", nil]; | |
if (number % 100 >= 11 && number % 100 <= 13) { | |
return [NSString stringWithFormat:@"%d%@", number, @"th"]; | |
} | |
return [NSString stringWithFormat:@"%d%@", number, [suffixLookup objectAtIndex:(number % 10)]]; | |
} |
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
/** | |
* NSMutableArray+Shuffle.h | |
* | |
* (c) Copyright 2011 David Wagner. | |
* | |
* Complain/commend: http://noiseandheat.com/ | |
* | |
* | |
* Licensed under the MIT license: | |
* |
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
// clang -W -Wall -Wno-unused-parameter -framework Foundation -fobjc-arc test.m | |
#import <Foundation/Foundation.h> | |
#define IDARRAY(...) ((id[]){ __VA_ARGS__ }) | |
#define IDCOUNT(...) (sizeof(IDARRAY(__VA_ARGS__)) / sizeof(id)) | |
typedef id (^Tuple)(int); |
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
self.view.layer.anchorPoint = CGPointMake(0.50, 1.0); | |
CAKeyframeAnimation *bounceAnimation = [CAKeyframeAnimation animationWithKeyPath:@"transform.scale"]; | |
bounceAnimation.values = [NSArray arrayWithObjects: | |
[NSNumber numberWithFloat:0.05], | |
[NSNumber numberWithFloat:1.08], | |
[NSNumber numberWithFloat:0.92], | |
[NSNumber numberWithFloat:1.0], | |
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 <Foundation/Foundation.h> | |
extern UIImage * UIImageWithJPEG2000Data( NSData * data ) ; |
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> | |
@interface A: NSObject | |
@end | |
@implementation A | |
void pileOfPoo(id self, SEL _cmd) { | |
NSLog(@"💩"); | |
} |
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/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
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
/* | |
* Most NSString instances will actually be __NSCFString instances, so here are both NSString and __NSCFString implementations. | |
* If you know how to create an NSString instance whose class is actually NSString please let me know. | |
* Other possible concrete subclasses of NSString are: NSConstantString, __NSCFConstantString, NSPathStore2, NSSimpleCString and __NSLocalizedString. | |
*/ | |
// CoreFoundation.framework 635.19.0 (Mac OS X 10.7.3) | |
@implementation NSObject | |
- (BOOL) isNSString__ |
OlderNewer