This file contains hidden or 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
| find . -name ".svn" -exec rm -Rf {} \; |
This file contains hidden or 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 "NSUserDefaults+Utilities.h" | |
| @implementation NSUserDefaults (Utilities) | |
| - (CGPoint)CGPointForKey:(NSString *)key | |
| { | |
| CGPoint pt = CGPointZero; | |
| NSArray *ptArray = [self objectForKey:key]; | |
| if (ptArray != nil) |
This file contains hidden or 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 "NSWindow+Utilities.h" | |
| @implementation NSWindow (Utilities) | |
| - (void)setTopLeftRelativeToMainScreen:(CGPoint)topLeftPt{ | |
| CGRect mainScreenVisibleFrame = NSScreen.mainScreen.visibleFrame; | |
| CGPoint pt = CGPointZero; | |
| pt.x = topLeftPt.x; | |
| pt.y = mainScreenVisibleFrame.origin.y + mainScreenVisibleFrame.size.height - topLeftPt.y; | |
| [self setFrameTopLeftPoint:pt]; |
This file contains hidden or 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
| @implementation UIImage (Alpha) | |
| - (UIImage *)alphaImage{ | |
| CGRect imageRect = CGRectMake(0, 0, self.size.width, self.size.height); | |
| CGColorSpaceRef rgbColorSpace = CGColorSpaceCreateDeviceRGB(); // create an RGB Color Space | |
| // create the context to do our drawing in | |
| CGContextRef context = CGBitmapContextCreate(NULL, imageRect.size.width, imageRect.size.height, 8, imageRect.size.width * 4, rgbColorSpace, kCGImageAlphaPremultipliedLast); | |
| // use the images alpha channel as a mask | |
| CGContextClipToMask(context, imageRect, self.CGImage); |
NewerOlder