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
[CATransaction begin]; | |
CATransition *transition = [CATransition animation]; | |
transition.type = kCATransitionFade; | |
transition.duration = animated ? 0.5f : 0.0f; | |
transition.fillMode = kCAFillModeForwards; | |
transition.removedOnCompletion = YES; | |
[[UIApplication sharedApplication].keyWindow.layer addAnimation:transition forKey:@"transition"]; | |
[[UIApplication sharedApplication] beginIgnoringInteractionEvents]; |
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
/* | |
* Copyright (c) 2007-2010 by Apple Inc.. All rights reserved. | |
* | |
* @APPLE_LICENSE_HEADER_START@ | |
* | |
* This file contains Original Code and/or Modifications of Original Code | |
* as defined in and that are subject to the Apple Public Source License | |
* Version 2.0 (the 'License'). You may not use this file except in | |
* compliance with the License. Please obtain a copy of the License at | |
* http://www.opensource.apple.com/apsl/ and read it before using this |
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
- (void)simulateMemoryWarning { | |
#if TARGET_IPHONE_SIMULATOR | |
#ifdef DEBUG | |
CFNotificationCenterPostNotification(CFNotificationCenterGetDarwinNotifyCenter(), (CFStringRef)@"UISimulatedMemoryWarningNotification", NULL, NULL, true); | |
#endif | |
#endif | |
} |
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
i?php | |
require_once('chorus/Utils.php'); | |
require_once('chorus/Kestrel.php'); | |
require_once('chorus/DataService.php'); | |
require_once('chorus/Shard.php'); | |
Database::set_defaults(array( | |
'user' => 'tumblr3', | |
'password' => 'm3MpH1C0Koh39AQD83TFhsBPlOM1Rx9eW55Z8YWStbgTmcgQWJvFt4', | |
'database' => 'tumblr3', |
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
BOOL isBackgroundingAvailable = (&UIApplicationDidEnterBackgroundNotification != NULL); | |
if (isBackgroundingAvailable) { | |
[[NSNotificationCenter defaultCenter] addObserver:self | |
selector:@selector(applicationWillEnterForegroundNotification:) | |
name:UIApplicationWillEnterForegroundNotification | |
object: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
// From NPR for iPad | |
-[MedialetsAdEvent initWithEventID:key:time:adID:conn:lat:lon:alt:uCount:uDur:uDict:horizontalAccuracy:verticalAccuracy:urlCounts:adExit:countHr:countDay:countMon:stringValues:numericValues:breadcrumbs:visitedAdEventLinks:durationValues:direction:directionAccuracy:adSlotName:adVersion:adChildAdID:adParentAdID:adIsAClone:] |
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 "NDVKVOMacros.h" | |
@implementation Foo | |
@synthesize bar; | |
- (id)init { |
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 UIView (CIImageAdditions) | |
- (CIImage *)CIImage { | |
UIImage* image = nil; | |
UIGraphicsBeginImageContext(self.frame.size); { | |
CGContextRef context = UIGraphicsGetCurrentContext(); | |
[self.layer renderInContext:context]; | |
image = UIGraphicsGetImageFromCurrentImageContext(); |
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
# Add this to your global ~/.gitconfig so that your read-only | |
# Git URLs (e.g. in submodules) are swapped out for your | |
# read-write URL | |
# | |
[url "https://[email protected]/USERNAME/"] | |
insteadOf = "git://github.com/USERNAME/" | |
insteadOf = "http://github.com/USERNAME/" |
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
# | |
# Takes a PNG that has been optimised by Xcode for display on iOS devices, and | |
# creates a new, unoptimised file that can be opened in Preview. If you don't | |
# supply a second argument, the output file will be named in-uncrushed.png | |
# | |
# See: http://developer.apple.com/iphone/library/qa/qa2010/qa1681.html | |
# | |
function uncrush() { | |
local infile="$1"; local outfile="$2" |