This file contains hidden or 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
body, | |
.toolbar { | |
background: transparent; | |
} | |
.toolbar .cart { | |
background: #f8f9fa; | |
} | |
.toolbar-counter { |
This file contains hidden or 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)viewDidLoad { | |
[super viewDidLoad]; | |
// This object will generate HTML requests for our WebView, that we will use to show the coupon | |
// details and fire the redemption | |
id theDelegate = [[UIApplication sharedApplication] delegate]; | |
self.requestFactory = [[theDelegate coupiesManager] requestFactoryForType:kCOUPIESRequestFactoryTypeHTML]; | |
// Load the details of the coupon and count the click | |
[webView loadRequest:[self.requestFactory requestForCouponWithId:(NSUInteger)self.coupon.couponId]]; |
This file contains hidden or 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)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken | |
{ | |
// ... | |
// Convert device token from NSData to NSString | |
NSMutableString* pushTokenString = [NSMutableString stringWithString:[self.description uppercaseString]]; | |
[pushTokenString replaceOccurrencesOfString:@"<" withString:@"" options:0 range:NSMakeRange(0, pushTokenString.length)]; | |
[pushTokenString replaceOccurrencesOfString:@">" withString:@"" options:0 range:NSMakeRange(0, pushTokenString.length)]; | |
[pushTokenString replaceOccurrencesOfString:@" " withString:@"" options:0 range:NSMakeRange(0, pushTokenString.length)]; | |

This file contains hidden or 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
require "formula" | |
class Mongodb < Formula | |
homepage "http://www.mongodb.org/" | |
url "http://downloads.mongodb.org/src/mongodb-src-r2.6.3.tar.gz" | |
sha1 "226ab45e3a2e4d4a749271f1bce393ea8358d3dd" | |
bottle do | |
sha1 "d573717ca7c67455680a6823de210c940faf9ac6" => :mavericks | |
sha1 "f7d2a0711e3ac09fd61bcb243360c1a07fb83233" => :mountain_lion |
This file contains hidden or 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
- (NSString *)daysSinceDate:(NSDate *)referenceDate | |
{ | |
NSDate *today = [NSDate date]; | |
NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; | |
NSCalendarUnit units = NSYearCalendarUnit | NSMonthCalendarUnit | NSWeekCalendarUnit | NSWeekdayCalendarUnit | NSDayCalendarUnit; | |
NSDateComponents *components = [gregorian components:units fromDate:referenceDate toDate:today options:0]; | |
NSInteger days = [components day]; | |
NSInteger years = [components year]; |
This file contains hidden or 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
// Override the following method in AFHTTPClient.m | |
- (void)setAuthorizationHeaderWithUsername:(NSString *)username password:(NSString *)password { | |
CFHTTPMessageRef dummyRequest = CFHTTPMessageCreateRequest(kCFAllocatorDefault, (CFStringRef)@"GET", (__bridge CFURLRef)[NSURL URLWithString:@"http://yourdummyurl.com"], kCFHTTPVersion1_1); | |
if (dummyRequest) { | |
CFHTTPMessageAddAuthentication(dummyRequest, nil, (__bridge CFStringRef)username, (__bridge CFStringRef)password,kCFHTTPAuthenticationSchemeBasic, FALSE); | |
CFStringRef authorizationString = CFHTTPMessageCopyHeaderFieldValue(dummyRequest, CFSTR("Authorization")); | |
if (authorizationString) { | |
NSLog(@"Authorization: %@", authorizationString); | |
[self setDefaultHeader:@"Authorization" value:[NSString stringWithFormat:@"%@", authorizationString]]; |