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 <UIKit/UIKit.h> | |
@interface UIScrollView (KeyboardInsets) | |
- (void)addInsetsForKeyboardHandlers; | |
- (void)removeInsetsForKeyboardHandlers; | |
@end |
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)viewDidLoad { | |
[super viewDidLoad]; | |
// Do any additional setup after loading the view, typically from a nib. | |
[self addObserver:self forKeyPath:@"DERP" options:NSKeyValueObservingOptionNew context:nil]; | |
} | |
- (void)viewDidAppear:(BOOL)animated | |
{ | |
[super viewDidAppear:animated]; |
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
class PlayerView : UIView { | |
var player: AVPlayer { | |
get{ | |
var layer = self.layer as AVPlayerLayer | |
return layer.player | |
} | |
set { | |
var layer: AVPlayerLayer = self.layer as AVPlayerLayer | |
layer.player = newValue |
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
// Taken from the commercial iOS PDF framework http://pspdfkit.com. | |
// Copyright (c) 2014 Peter Steinberger, PSPDFKit GmbH. All rights reserved. | |
// Licensed under MIT (http://opensource.org/licenses/MIT) | |
// | |
// You should only use this in debug builds. It doesn't use private API, but I wouldn't ship it. | |
#import <objc/runtime.h> | |
#import <objc/message.h> | |
// Compile-time selector checks. |
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
NSMutableArray *mutArry = [[NSMutableArray alloc] init]; | |
// Fill array with 20 dictionaries that each contain a NSNumber for key "num" | |
for(int i = 0;i<20;i++){ | |
NSDictionary *dict = [[NSDictionary alloc] initWithObjectsAndKeys:[NSNumber numberWithInt:arc4random()%100], @"num", nil]; | |
[mutArry addObject:dict]; | |
} | |
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
<?php | |
!function_exists('profiler_v2') ? require_once('libraries/profiler/profiler.inc') : FALSE; | |
profiler_v2('ppc_test'); | |
/** | |
* Implement hook_install(). | |
* |
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 <Foundation/Foundation.h> | |
@interface NSString (Evil) | |
@property(assign, setter=initWithString:) NSString *initWithString; | |
@property(assign, readonly) NSString *test; | |
@property(assign, readonly) NSArray *(^split)(NSString *); | |
@end | |
int main(int argc, char *argv[]) | |
{ |
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
# | |
# This is the main Apache server configuration file. It contains the | |
# configuration directives that give the server its instructions. | |
# See <URL:http://httpd.apache.org/docs/2.2/> for detailed information. | |
# In particular, see | |
# <URL:http://httpd.apache.org/docs/2.2/mod/directives.html> | |
# for a discussion of each configuration directive. | |
# | |
# | |
# Do NOT simply read the instructions in here without understanding |
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
PATH=$PATH:$HOME/.rvm/bin # Add RVM to PATH for scripting | |
# make ls display colors, reinforce with CLICOLOR and LSCOLORS | |
export CLICOLOR=1 | |
# LSCOLORS order: DIR, SYM_LINK, SOCKET, PIPE, EXE, BLOCK_SP | |
# CHAR_SP, EXE_SUID, EXE_GUID, DIR_STICKY, DIR_WO_STICKY | |
# a = black, b = red, c = green, d = brown, e = blue, | |
# f = magenta g = cyan, h = light gray, x = default |
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
#define DERP 1234 | |
#define MACRO_NAME(str) @ #str | |
#define STRINGIFY(str) MACRO_NAME(str) | |
NSLog(@"%@",MACRO_NAME(DERP)); | |
NSLog(@"%@",STRINGIFY(DERP)); | |
// Output: |