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
+ (UIImage *)decompressedImageWithImage:(UIImage *)image resizeTo:(CGSize)targetSize | |
{ | |
CGImageRef imageRef = image.CGImage; | |
CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); | |
CGImageAlphaInfo alphaInfo = CGImageGetAlphaInfo(imageRef); | |
BOOL sameSize = NO; | |
if (CGSizeEqualToSize(targetSize, CGSizeMake(CGImageGetWidth(imageRef), CGImageGetHeight(imageRef)))) { | |
targetSize = CGSizeMake(1, 1); | |
sameSize = YES; | |
} |
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
// | |
// NSUserDefaults+ObjectSubscripting.h | |
// | |
// Created by Tony Arnold on 29/07/12. | |
// Copyright (c) 2012 The CocoaBots. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> | |
@interface NSUserDefaults (ObjectSubscripting) |
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
// | |
// TransitionController.h | |
// | |
// Created by XJones on 11/25/11. | |
// | |
#import <UIKit/UIKit.h> | |
@interface TransitionController : UIViewController |
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
/* | |
File: Reachability.h | |
Abstract: Basic demonstration of how to use the SystemConfiguration Reachablity APIs. | |
Version: 2.2 - ARCified | |
Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Inc. | |
("Apple") in consideration of your agreement to the following terms, and your | |
use, installation, modification or redistribution of this Apple software |
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
#chmod a+x {this_file} to make executable and add it to $PATH | |
query=$(echo $1 | sed 's/ /\+/g') | |
curl -A "Mozilla/2.01" "http://www.google.com/search?source=ig&hl=en&rlz=&q=$query&btnG=Google+Search" 2>/dev/null| | |
tr '>' '\n' 2>/dev/null| | |
grep "<h3 class=\"r\"" -A 1| | |
grep "href="| | |
sed 's/.*href="//'| | |
sed 's/".*//'| | |
head -n 1 | |