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
UIWebView *webView = [[UIWebView alloc] initWithFrame:[UIScreen mainScreen].bounds]; | |
webView.delegate = self; | |
webView.autoresizingMask = UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleBottomMargin; | |
NSURL *htmlPath = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"about" ofType:@"html"]isDirectory:NO]; | |
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0); | |
dispatch_async(queue, ^{ | |
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
// loadRequest | |
UIWebView *webView = [[UIWebView alloc] initWithFrame:[UIScreen mainScreen].bounds]; | |
NSURL *htmlPath = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"about" | |
ofType:@"html"] isDirectory:NO]; | |
NSURLRequest *request = [NSURLRequest requestWithURL:htmlPath]; | |
[webView loadRequest:request]; | |
[self.view addSubview:webView]; | |
[webView release]; |
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
// loadRequest | |
UIWebView *webView = [[UIWebView alloc] initWithFrame:[UIScreen mainScreen].bounds]; | |
NSURL *htmlPath = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"about" ofType:@"html"] isDirectory:NO]; | |
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0); | |
dispatch_async(queue, ^{ | |
NSURLRequest *request = [NSURLRequest requestWithURL:htmlPath]; | |
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
x = ''; (1..1000000).each { |c| x << c.to_s } |
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
def method6(): | |
return ''.join([`num` for num in xrange(loop_count)]) |
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
#!/usr/bin/env python | |
# Written by Cory D. Wiles (http://twitter.com/kwylez) and Bob Waycott (http://twitter.com/bobwaycott) | |
# Inspired by original work of Javier de la Torre ([email protected] @jatorre) | |
# Ruby script: https://gist.github.com/1610866 | |
import csv | |
import time | |
from simplegeo import Client |
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 param typedef | |
typedef void (^ForwardGeoCompletionBlock)(CLLocationCoordinate2D coords); | |
// Fetch Records Method | |
- (void)fetchForwardGeocodeAddress:(NSString *)address withCompletionHanlder:(ForwardGeoCompletionBlock)completion { | |
if (NSClassFromString(@"CLGeocoder")) { | |
CLGeocoder *geocoder = [[CLGeocoder alloc] init]; |
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> | |
#import <CoreLocation/CoreLocation.h> | |
@interface CWCLocationManager : NSObject <CLLocationManagerDelegate> { | |
CLLocationManager *locationManager; | |
CLLocation *currentLocation; | |
NSDate *locationManagerStartDate; | |
NSTimer *locationTimer; |
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)dealloc { | |
[super dealloc]; | |
[[CWCLocationManager sharedInstance] removeObserver:self | |
forKeyPath:@"currentLocation"]; | |
} | |
- (id)init { | |
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
// json file | |
{ | |
"Accounts":[{ | |
"AccountNumber":"String content", | |
"Address":{ | |
"Address1":"String content", | |
"Address2":"String content", | |
"City":"String content", | |
"State":"String content", | |
"ZipCode":"String content" |