Skip to content

Instantly share code, notes, and snippets.

Kyle Stewart kylestew

Block or report user

Report or block kylestew

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@kylestew
kylestew / KSCenteredTextView
Created Apr 18, 2014
KSCenteredTextView - Auto Vertical Centering UITextView
View KSCenteredTextView
#import <UIKit/UIKit.h>
@interface KSCenteredTextView : UITextView
@end
#import "KSCenteredTextView.h"
@implementation KSCenteredTextView
@kylestew
kylestew / jtreveal_sample
Created Feb 28, 2012
JTRevealSidebar Sample Snippet
View jtreveal_sample
- (UIView*)viewForLeftSidebar {
if (!_sampleViewController) {
_sampleViewController = [[UISampleViewController alloc] init];
CGRect viewFrame = self.navigationController.applicationViewFrame;
_sampleViewController.delegate = self;
_sampleViewController.view.frame = CGRectMake(0, viewFrame.origin.y, kSidebarWidth, viewFrame.size.height);
_sampleViewController.view.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleHeight;
}
return _sampleViewController;
}
@kylestew
kylestew / gist:1896076
Created Feb 24, 2012
Perform Block Selector Example
View gist:1896076
// Allows the loading UI to display
showLoadingHUD(self.view);
[self performBlock:^(void) {
// code executed after delay
hideLoadingHUD(self.view);
} afterDelay:0];
@kylestew
kylestew / NSObject+PWObject.c
Created Feb 24, 2012
Category - Perform Block After Delay
View NSObject+PWObject.c
#import "NSObject+PWObject.h"
@implementation NSObject (PWObject)
- (void)performBlock:(void (^)(void))block afterDelay:(NSTimeInterval)delay {
int64_t delta = (int64_t)(1.0e9 * delay);
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, delta), dispatch_get_main_queue(), block);
}
@end
@kylestew
kylestew / NSObject+PWObject.c
Created Feb 24, 2012
Category - Perform Block After Delay
View NSObject+PWObject.c
#import "NSObject+PWObject.h"
@implementation NSObject (PWObject)
- (void)performBlock:(void (^)(void))block afterDelay:(NSTimeInterval)delay {
int64_t delta = (int64_t)(1.0e9 * delay);
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, delta), dispatch_get_main_queue(), block);
}
@end
View restdroid_example.java
RestResponse response = RestDroid.Post(SERVER + "/people",
"person[fname]=Barbados", "person[lname]=Slim", "person[age]=42");
if (!response.error && response.statusCode == 201) {
// Use the response
}
You can’t perform that action at this time.