I hereby claim:
- I am donohue on github.
- I am bthdonohue (https://keybase.io/bthdonohue) on keybase.
- I have a public key whose fingerprint is 6782 B8C0 FF5D CE47 80DE 6E44 CF38 6FB3 4639 9BD7
To claim this, I am signing this object:
| #!usr/bin/env python | |
| import sys | |
| with open(sys.argv[1]) as f: | |
| unified_set = set([]) | |
| for line in f.readlines(): | |
| unified_set.add(line.strip()) | |
| for item in unified_set: | |
| print item |
| OperationalError: (OperationalError) (1114, "The table 'bookmarks' is full") |
I hereby claim:
To claim this, I am signing this object:
| - (NSURL *)URLFromText:(NSString *)text { | |
| NSArray *components = [text componentsSeparatedByCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]; | |
| NSURL *ret = nil; | |
| for (NSString *part in components) { | |
| NSURL *urlCheck = [NSURL URLWithString:part]; | |
| if (urlCheck && | |
| ([urlCheck.scheme isEqualToString:@"http"] || | |
| [urlCheck.scheme isEqualToString:@"https"])) { | |
| ret = urlCheck; | |
| break; |
| - (UIImage *)scaleAndRotateImage:(UIImage *)image { | |
| int kMaxResolution = 320; // Or whatever | |
| CGFloat scale = 1.0; | |
| if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) { | |
| scale = [[UIScreen mainScreen] scale]; | |
| kMaxResolution *= scale; | |
| } | |
| CGImageRef imgRef = image.CGImage; | |
| def fragmention(self, bookmark): | |
| # Normalize whitespace and encode text as UTF8 | |
| text = ' '.join(self.text.split()).encode('utf-8') | |
| url_parts = urlparse(bookmark.url) | |
| # If the URL has no path (i.e. http://google.com) add a "/" then append fragmention | |
| formatter = '%s/##%s' if not len(url_parts.path) else '%s##%s' | |
| fragmention_url = formatter % (url_parts.geturl(), urllib.quote_plus(text)) | |
| BOOL ret = [[UIApplication sharedApplication] setKeepAliveTimeout:600 handler:^(void) { | |
| if (updating_location) { | |
| [location_manager stopUpdatingLocation]; | |
| NSLog(@"Keep alive: Stopping location updates"); | |
| } | |
| else { | |
| [location_manager startUpdatingLocation]; | |
| NSLog(@"Keep alive: Starting location updates"); | |
| } | |
| location_manager = [[CLLocationManager alloc] init]; | |
| location_manager.desiredAccuracy = kCLLocationAccuracyBest; | |
| location_manager.delegate = self; | |
| [location_manager startUpdatingLocation]; | |
| updating_location = YES; |