Skip to content

Instantly share code, notes, and snippets.

View johnclayton's full-sized avatar

John Clayton johnclayton

View GitHub Profile
[DEBUG] - LNPaymentCertificateSyncAgent.m:69 -[LNPaymentCertificateSyncAgent shouldSyncNow] - LNPaymentCertificateSyncAgent: LNSyncAgentStrategyDelegate - shouldSyncNow (NO)
[TRACE] - SMWebServiceRequest.m:335 -[SMWebServiceRequest configureURLRequest:] - Cookies for URL tap/endpoint/restv1/member -- https://ash1api.ticketmaster.com : (
)
[TRACE] - SMWebServiceRequest.m:336 -[SMWebServiceRequest configureURLRequest:] - All cookies: (
"<NSHTTPCookie version:0 name:@\"JSESSIONID\" value:@\"448C8D57E3A4CA39CC1B7393D894D85D\" expiresDate:@\"(null)\" created:@\"303897572.000000\" sessionOnly:TRUE domain:@\"ash1api.ticketmaster.com\" path:@\"/tap\" secure:FALSE comment:@\"(null)\" commentURL:@\"(null)\" portList:[]>",
"<NSHTTPCookie version:0 name:@\"BID\" value:@\"xEW2EokI6XdEiU8SG4QbPY3PGbgucu3b8mstr0_fbAvYajvBKupwcLg4pTEpL8hWJxxH-wpZrehrpkd6ZnSn\" expiresDate:@\"2037-12-31 16:00:01 -0800\" created:@\"303897556.000000\" sessionOnly:FALSE domain:@\".ticketmaster.com\" path:@\"/\" secure:FALSE comment:@\"(n
[TRACE] - SMWebServiceRequest.m:335 -[SMWebServiceRequest configureURLRequest:] - Cookies for URL tap/endpoint/restv1/certificate -- https://ash1api.ticketmaster.com : (
)
[TRACE] - SMWebServiceRequest.m:336 -[SMWebServiceRequest configureURLRequest:] - All cookies: (
"<NSHTTPCookie version:0 name:@\"JSESSIONID\" value:@\"5DFD1967F3F5B179F2C20E3B05B7608E\" expiresDate:@\"(null)\" created:@\"303897263.000000\" sessionOnly:TRUE domain:@\"ash1api.ticketmaster.com\" path:@\"/tap\" secure:FALSE comment:@\"(null)\" commentURL:@\"(null)\" portList:[]>",
"<NSHTTPCookie version:0 name:@\"TAPCID\" value:@\"ash1-1282204457\" expiresDate:@\"(null)\" created:@\"303897258.000000\" sessionOnly:TRUE domain:@\"ash1api.ticketmaster.com\" path:@\"/tap\" secure:FALSE comment:@\"(null)\" commentURL:@\"(null)\" portList:[]>",
"<NSHTTPCookie version:0 name:@\"BID\" value:@\"9l7alBBUVuaQbExIomCRui6MrAkR8aSxJjQ0XscqJVFZj-d6YuIyL2cVoRjYQK6vZ2yRBgKZjMu3BkrGxAz2\" expiresDate:@\"2037-12-31 16:00:01 -0800\" created:@\"3038972

Welcome to Drift!

Drift is an always-already versioned, cloud-backed text editor. You can use it to take notes, and save them in the GitHub cloud.

Your gists are always saved locally, and any changes you make will get pushed to GitHub's servers.

To name a gist, touch its name in the toolbar.

You can use the share button at the top-right to copy a link to one of your gists, or view it on the web in Safari.

@johnclayton
johnclayton / FSQOpenStruct.h
Created February 22, 2012 16:04
An implementation of Ruby's OStruct in Objective C
//
// FSQOpenStruct.h
// FivesquareKit
//
// Created by John Clayton on 2/5/12.
// Copyright (c) 2012 Fivesquare Software, LLC. All rights reserved.
//
#import <Foundation/Foundation.h>
- (UITextField *) textField {
UITextField *textField = nil;
for (id subview in [self subviews]) {
if ([subview isKindOfClass:[UITextField class]]) {
textField = (UITextField *)subview;
break;
}
}
return textField;
}
@johnclayton
johnclayton / gist:4468789
Created January 6, 2013 17:23
NSString empty checks
@interface NSString (FSQFoundation)
+ (BOOL) isEmpty:(NSString *)string;
+ (BOOL) isNotEmpty:(NSString *)string;
@end
@implementation NSString (FSQFoundation)
+ (BOOL) isEmpty:(NSString *)string {
@johnclayton
johnclayton / gist:4468810
Created January 6, 2013 17:28
NSArray first element convenience
@interface NSArray (FSQFoundation)
- (id) firstObject; ///< @returns the first object if there is one, or nil.
@end
@implementation NSArray (FSQFoundation)
- (id) firstObject {
if (self.count < 1) {
+ (NSString *)nibName {
return [self className];
}
+ (id) loadFromNib {
return [self loadFromNibWithOwner:self];
}
+ (id) loadFromNibWithOwner:(id)owner {
NSArray *theObjects = [[NSBundle mainBundle] loadNibNamed:[self nibName] owner:owner options:nil];
- (NSString *) MD5Hash {
const char *cStr = [self UTF8String];
unsigned char result[CC_MD5_DIGEST_LENGTH];
CC_MD5( cStr, (CC_LONG)strlen(cStr), result );
NSMutableString *hash = [[NSMutableString alloc] initWithCapacity:CC_MD5_DIGEST_LENGTH * 2];
for (int i = 0; i < 16; i++) {
[hash appendFormat: @"%02x", result[i]];
}
@johnclayton
johnclayton / QSandbox
Last active December 19, 2015 09:58
A convenient wrapper around the sandbox for OSX and iOS apps
@implementation QSandbox
+ (NSString *) documentsDirectory {
return [self directoryInUserSearchPath:NSDocumentDirectory];
}
+ (NSString *) applicationSupportDirectory {
return [self directoryInUserSearchPath:NSApplicationSupportDirectory];
}