Get it from the App Store.
In XCode's Preferences > Downloads you can install command line tools.
require "heroku" | |
client = Heroku::Client.new("username", "password") | |
# Update the number of dynos used by the application | |
# app_name = the name of the application | |
# x = the integer number of dynos you want to set, e.g. 3 | |
client.set_dynos("app_name", x) | |
# Update the number of workers used by the application |
// NSNotificationCenter+MainThread.h | |
@interface NSNotificationCenter (MainThread) | |
- (void)postNotificationOnMainThread:(NSNotification *)notification; | |
- (void)postNotificationOnMainThreadName:(NSString *)aName object:(id)anObject; | |
- (void)postNotificationOnMainThreadName:(NSString *)aName object:(id)anObject userInfo:(NSDictionary *)aUserInfo; | |
@end |
QPickOneView* myView = nil; | |
NSArray* nibViews = [[NSBundle mainBundle] loadNibNamed:@"QPickOneView" owner:self options:nil]; | |
for (id currentObject in nibViews) { | |
if ([currentObject isKindOfClass:[QPickOneView class]]) { | |
myView = (QPickOneView *) currentObject; | |
break; | |
} | |
} |
// Initialize namespaces --------------------- | |
if (!window.mm) { | |
mm = {}; | |
} | |
// avoid window. use this if you "think" you are in root closure. makes encapsulation possible and code executable without DOM (like node...) | |
if (!this.mm) { | |
mm = {}; | |
} | |
// | |
// Created by Jörg Polakowski on 25/04/13. | |
// Copyright (c) 2013 Jörg Polakowski. All rights reserved. | |
// | |
@interface SectionArray : NSObject | |
#pragma mark - | |
#pragma mark Factory |
// Define callback blocks | |
// Success | |
__block typeof (self) weakSelf = self; | |
void (^successBlock)(NSURLRequest *, NSHTTPURLResponse *, UIImage *) = | |
^(NSURLRequest *request, NSHTTPURLResponse *response, UIImage *image) { | |
// Assigning an image that has not yet been decoded leads | |
// to stuttering in UI animations | |
// Forcing image decoding on a background thread fixes this | |
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_LOW, 0), ^(void) { |
@interface NSObject (IndieBandName) | |
@property (nonatomic, strong) NSString *indieBandName; | |
@end |
NS_INLINE void MVComputeTimeWithNameAndBlock(const char *caller, void (^block)()) { | |
CFTimeInterval startTimeInterval = CACurrentMediaTime(); | |
block(); | |
CFTimeInterval nowTimeInterval = CACurrentMediaTime(); | |
NSLog(@"%s - Time Running is: %f", caller, nowTimeInterval - startTimeInterval); | |
} | |
#define MVComputeTime(...) MVComputeTimeWithNameAndBlock(__PRETTY_FUNCTION__, (__VA_ARGS__)) |
+ (NSNumberFormatter *)numberFormatter { | |
static NSNumberFormatter *_numberFormatter = nil; | |
static dispatch_once_t onceToken; | |
dispatch_once(&onceToken, ^{ | |
_numberFormatter = [[NSNumberFormatter alloc] init]; | |
[_numberFormatter setNumberStyle:NSNumberFormatterDecimalStyle]; | |
}); | |
return _numberFormatter; | |
} |