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 API { | |
private var firstCompletionHandlers: [() -> ()] = [] | |
private var hasCompletedFirst = false | |
private func completeFirst() { | |
hasCompletedFirst = true | |
// API CALL RESPONSE | |
if firstCompletionHandlers.count > 0 { | |
for value in firstCompletionHandlers { |
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
#include <stdio.h> | |
#include "GLK2GetError.h" | |
#include <GLKit/GLKit.h> | |
void _gl2CheckAndClearAllErrorsImpl(char *source_function, char *source_file, int source_line) | |
{ | |
GLenum glErrorLast; | |
while( (glErrorLast = glGetError()) != GL_NO_ERROR ) // GL spec says you must do this in a WHILE loop | |
{ | |
/** OpenGL spec defines only 6 legal errors, that HAVE to be re-used by all gl method calls. OH THE PAIN! */ |
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 UIView (ResourceHelper) | |
- (void)rh_applyBorderOffset:(CGRect)offset; | |
@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
- (NSArray*)listOfNames { | |
NSFetchRequest *request = [[NSFetchRequest alloc] init]; | |
[request setEntity:[NSEntityDescription entityForName:@"SomeObject" inManagedObjectContext:self.managedObjectContext]]; | |
[request setResultType:NSDictionaryResultType]; | |
[request setPropertiesToFetch:[NSArray arrayWithObject:@"name"]]; | |
[request setPropertiesToGroupBy:[NSArray arrayWithObject:@"name"]]; | |
[request setPredicate:[NSPredicate predicateWithFormat:@"type = %@", @"static"]]; |
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)deleteFile:(NSString*)file { | |
[[HMAlertView alertViewWithTitle:@"Delete File" | |
message:@"Are you sure?" | |
cancelTitle:NSLocalizedString(@"No", @"") | |
cancelAction:nil | |
confirmTitle:NSLocalizedString(@"Yes", @"") | |
confirmAction:^(void) { | |
[[NSFileManager defaultManager] removeItemAtPath:file error:nil]; | |
}] show]; | |
} |
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
/* iOS scrollpane jQuery plugin, v1.0 | |
* ================================== | |
* | |
* (c) 2011 Dave Gurnell | |
* http://boxandarrow.com | |
* | |
* Distributed under the Creative Commons Attribution 3.0 Unported licence: | |
* http://creativecommons.org/licenses/by/3.0/ | |
*/ |