Skip to content

Instantly share code, notes, and snippets.

View MugunthKumar's full-sized avatar

Mugunth Kumar MugunthKumar

View GitHub Profile
@krzysztofzablocki
krzysztofzablocki / gist:3951442
Created October 25, 2012 08:34
Image decompression
+ (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;
}
@tonyarnold
tonyarnold / NSUserDefaultsObjectSubscripting.h
Created July 29, 2012 07:51
Add simple object subscripting to NSUserDefaults
//
// 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)
@xjones
xjones / TransitionController.h
Created November 26, 2011 03:48
TransitionController for animating iOS view controller transitions w/o a controller stack
//
// TransitionController.h
//
// Created by XJones on 11/25/11.
//
#import <UIKit/UIKit.h>
@interface TransitionController : UIViewController
@darkseed
darkseed / Reachability.h
Created August 30, 2011 23:16 — forked from dhoerl/Reachability.h
Reachability (iOS) ARCified
/*
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
@abi
abi / gist:729922
Created December 6, 2010 05:33
A simple script that searches Google and copies the first result link to your clipboard. Usage : google "julian assange"
#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 |