I hereby claim:
- I am jpmhouston on github.
- I am jpmhouston (https://keybase.io/jpmhouston) on keybase.
- I have a public key ASAvAMoNWlz7u41pqqpci8CXG1_2hzd_M7xuRrQDerLJuwo
To claim this, I am signing this object:
@interface NSObject (Backtrace) | |
+ (NSString *)appBacktraceOfDepth:(int)depth fromStackSymbols:(NSArray *)frames; | |
+ (NSString *)backtraceOfDepth:(int)depth fromStackSymbols:(NSArray *)frames; | |
+ (NSString *)backtraceOfDepth:(int)depth fromStackSymbols:(NSArray *)frames matching:(NSString *)from; | |
@end | |
#define BACKTRACE_DEPTH(DEPTH) ([[NSThread class] respondsToSelector:@selector(callStackSymbols)] ? [NSObject appBacktraceOfDepth:DEPTH fromStackSymbols:[NSThread callStackSymbols]] : @"") | |
#define CALLSTACK_DEPTH(DEPTH) BACKTRACE_DEPTH(DEPTH) |
#import <Foundation/Foundation.h> | |
@interface AsyncOperation : NSOperation | |
@property (nonatomic, assign) BOOL isExecuting; // yes, explicity not '.. getter=isExecuting) BOOL executing' | |
@property (nonatomic, assign) BOOL isFinished; // the KVC keys must be isExecuting & isFinished, with the 'is' | |
typedef void (^FinishBlock)(void); | |
+ (instancetype)asyncOperationWithBlock:(void (^)(FinishBlock finishBlock))block; |
@implementation NSDictionary (MapDictKeysContainingPeriods) | |
- (NSDictionary *)dictionaryWithPeriodsInKeysMappedTo:(NSString *)replacement | |
{ | |
NSMutableDictionary *updatedDictionary = [self mutableCopy]; | |
NSAssert1(updatedDictionary != self, @"mutableCopy returned same object pointer: %@", updatedDictionary); // i don't think this ever happens | |
BOOL changed = NO; | |
for (NSString *key in updatedDictionary.allKeys) | |
{ | |
id value = [updatedDictionary objectForKey:key]; |
https://api.login.yahoo.com/oauth/v2/get_request_token?oauth_callback=http%3A%2F%2Flocalhost&oauth_consumer_key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx--&oauth_nonce=9D342B75-2A27-4A88-93E5-53DD4AE292F8&oauth_signature=sC0HZuTJySrxLCASwkvzbOwl1J4%3D&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1425086133&oauth_version=1.0 | |
signature is generated from putting these parameters into the base string, in correct sorted order: | |
oauth_callback=http%3A%2F%2Flocalhost& | |
oauth_consumer_key=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx--& | |
oauth_nonce=53DBBE7A-9A1F-4113-BFD3-26B31547CEA7& | |
oauth_signature_method=HMAC-SHA1& | |
oauth_timestamp=1425324801& | |
oauth_version=1.0 |
** Generating signature for https://api.login.yahoo.com/oauth/v2/get_request_token | |
** Parameters for base signature string: | |
oauth_callback=http%3A%2F%2Flocalhost& | |
oauth_consumer_key=dj0yJmk9Q1BTWWoxZVd0QlBGJmQ9WVdrOWVGcEVWbWxTTldrbWNHbzlNQS0tJnM9Y29uc3VtZXJzZWNyZXQmeD1hMQ--& | |
oauth_nonce=48FD2DE7-0380-40AA-BF8C-3C61341ACCCE& | |
oauth_signature_method=HMAC-SHA1& | |
oauth_timestamp=1425329590& | |
oauth_version=1.0 | |
** Base signature string: |
I hereby claim:
To claim this, I am signing this object:
Verifying I am +jpmhouston on my passcard. https://onename.com/jpmhouston |
@interface MixedPOSTHTTPSessionManager : AFHTTPSessionManager | |
- (NSURLSessionDataTask *)POST:(NSString *)URLString | |
parameters:(id)parameters | |
JSONParameters:(NSDictionary *)jsonParameters | |
success:(void (^)(NSURLSessionDataTask *task, id responseObject))success | |
failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure; | |
@end | |
@implementation MixedPOSTHTTPSessionManager |
// call from a view controller's -viewDidLayoutSubviews or -viewWillAppear: | |
// pass it a text field, etc, assign result to that text field's attributedPlaceholder property | |
// note that the maxKerning parameter must be a negative value (a "maximally negative" kerning value) | |
// pro tip: i've sometimes found that a text field still has incorrect bounds in -viewDidLayoutSubviews | |
// and needs to forcibly have its layout done: | |
//- (void)viewDidLayoutSubviews { | |
// [self.field layoutIfNeeded]; | |
// self.field.attributedPlaceholder = [self resizedPlaceholderForField:self.field withPadding:4.0 maxKerningReduction:0.3]; | |
//} |