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
#ifndef _DCT_WEAK_H | |
#define _DCT_WEAK_H | |
// Macros for portable support of notionally weak properties with ARC | |
// Forked from https://gist.github.com/1354106 | |
// Updated by Rowan James | |
// Available at https://gist.github.com/1530868 | |
// Defines: | |
// dct_weak to be used as a replacement for the 'weak' keyword: | |
// @property (dct_weak) NSObject* propertyName; |
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
# Install libxml2 using Homebrew | |
# If you don't have Homebrew, follow the instructions at: | |
# https://github.com/mxcl/homebrew/wiki/Installation | |
# ------------------------------------------------------- | |
brew install libxml2 | |
# Install libxslt from source code | |
# If you don't have wget, follow the instructions at: | |
# http://www.mactricksandtips.com/2008/07/installing-wget-on-your-mac-for-terminal.html | |
# Or use Homebrew: |
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
// | |
// CCamera.h | |
// CCamera | |
// | |
// Created by Jonathan Wight on 7/12/12. | |
// Copyright (c) 2012 Jonathan Wight. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> |
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
desc "Create a new version tag and push a new podspec" | |
task :release do | |
require 'cocoapods' | |
require 'colored' | |
version = Pod::Specification.from_file(Pathname.pwd + 'MyLib.podspec').version | |
puts "Releasing version `#{version}'. Is that correct? (y/n)" | |
if $stdin.gets.strip.downcase == 'y' | |
sh "git tag -a #{version} -m 'Release #{version}'" | |
sh "git push --tags" | |
sh "pod lint" |
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
// Defines a yet undocumented method to add a warning if super isn't called. | |
#ifndef NS_REQUIRES_SUPER | |
#if __has_attribute(objc_requires_super) | |
#define NS_REQUIRES_SUPER __attribute((objc_requires_super)) | |
#else | |
#define NS_REQUIRES_SUPER | |
#endif | |
#endif |
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
__block void(^block)(int) = ^(int i) { | |
printf("%d", i); | |
if (i > 0) { | |
block(i-1); | |
} else { | |
block = nil; | |
} | |
}; | |
block(9); |
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
- (void)takeControlOfTheCookies | |
{ | |
[[NSHTTPCookieStorage sharedHTTPCookieStorage] setCookieAcceptPolicy:NSHTTPCookieAcceptPolicyAlways]; | |
} | |
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
{ | |
[self takeControlOfTheCookies]; |
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
// For https://twitter.com/nicklockwood/status/819938181483233285 | |
protocol Withable { | |
init() | |
} | |
extension Withable { | |
func with(_ body: (inout Self) -> ()) -> Self { | |
var copy = self | |
body(©) |
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
static NSData *PSPDFCalculateSHA256FromFileURL(NSURL *fileURL, CC_LONG dataLength, NSError **error) { | |
NSCParameterAssert(fileURL); | |
dispatch_queue_t shaQueue = dispatch_queue_create("com.pspdfkit.sha256-queue", DISPATCH_QUEUE_SERIAL); | |
__block dispatch_io_t readChannel; | |
void (^processIntError)(int intError) = ^(int intError) { | |
if (intError != 0) { | |
PSPDFLogWarning(@"Stream error: %d", intError); | |
if (error) *error = [NSError errorWithDomain:@"SHA256Error" code:100 userInfo:@{NSLocalizedDescriptionKey: @"failed to open file for calculating SHA256."}]; |
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 "Aspects.h" | |
#import "fishhook.h" | |
#import <dlfcn.h> | |
// UIAnimationDragCoefficient | |
// UISimulatedApplicationResizeGestureEnabled | |
// UIExternalTouchSloppinessFactor | |
// UIEnableParallaxEffects | |
// UIDeviceUsesLowQualityGraphics |
OlderNewer