This file contains 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
// | |
// Detect's the user's mobile client | |
// If it is a matched client, creates a referral item in parse and returns a redirect URL for the AppStore | |
// | |
function createReferral($params = array()) { | |
require_once '../cms/Mobile_Detect.php'; | |
$detect = new Mobile_Detect; | |
$ios_url = 'https://itunes.apple.com/us/app/aftermath-pvp-guilds-strategy/id702615597?ls=1&mt=8'; | |
$clients = array('iPhone'=>$ios_url, |
This file contains 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
// | |
// Detect's the user's mobile client | |
// If it is a matched client, creates a referral item in parse and returns a redirect URL for the AppStore | |
// | |
function createReferral($params = array()) { | |
require_once '../cms/Mobile_Detect.php'; | |
$detect = new Mobile_Detect; | |
$ios_url = 'https://itunes.apple.com/us/app/aftermath-pvp-guilds-strategy/id702615597?ls=1&mt=8'; | |
$clients = array('iPhone'=>$ios_url, |
This file contains 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
__weak typeof (self) wself = self; | |
[self runRequest:request handler:^(NSError *err) { | |
__strong typeof (wself) sself = wself; | |
__weak typeof(sself) wself2 = sself; | |
[sself runSecondRequest:data handler:^(NSError *err) { | |
__strong typeof (wself2) sself2 = wself2; | |
[sself2 doStuff]; | |
}]; | |
}]; |
This file contains 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
// | |
// SNFirebase.h | |
// SharedNotes | |
// | |
// Created by Zane Claes on 4/12/14. | |
// Copyright (c) 2014 inZania LLC. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> | |
#import <Firebase/Firebase.h> |
This file contains 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
// | |
// SNFirebase.m | |
// SharedNotes | |
// | |
// Created by Zane Claes on 4/12/14. | |
// Copyright (c) 2014 inZania LLC. All rights reserved. | |
// | |
#import "SNFirebase.h" |
This file contains 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
// | |
// SNFirebase.m | |
// SharedNotes | |
// | |
// Created by Zane Claes on 4/12/14. | |
// Copyright (c) 2014 inZania LLC. All rights reserved. | |
// | |
#import "SNFirebase.h" |
This file contains 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
// | |
// SNFirebase.m | |
// SharedNotes | |
// | |
// Created by Zane Claes on 4/12/14. | |
// Copyright (c) 2014 inZania LLC. All rights reserved. | |
// | |
#import "SNFirebase.h" | |
#import <Firebase/Firebase.h> |
This file contains 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)choosePaymentInstrument:(BBPaymentInstrument*)instrument { | |
NSAssert(instrument.paymentInstrumentId, @"instrument must have an ID"); | |
NSString *endpoint = [NSString stringWithFormat:@"/trip_invoices/%d",(int)self.tripInvoice.tripInvoiceId.integerValue]; | |
NSDictionary *params = @{@"op":@"add",@"path":@"/payment_instrument_id",@"value":instrument.paymentInstrumentId}; | |
[self showLoadingView:NO blocking:NO]; | |
[[BBAPI V2] patch:endpoint withParams:params onSuccess:^(id object) { | |
[self dismissLoadingView]; | |
[self.tableView triggerPullToRefresh]; | |
} onFailure:^(NSError *e) { |
This file contains 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
NSNumber *limitParam = (limit) ? @(limit) : @50; | |
NSNumber *offsetParam = (offset) ? @(offset) : @0; | |
NSDictionary *params = @{@"_format": @"v1_legacy", | |
(host ? @"host_id" : @"guest_id") : [BBUser activeUser].userId ?: @(0), | |
@"offset" : offsetParam, | |
@"items_per_page" : limitParam, | |
@"include_pending" : includePending ? @"true" : @"false", | |
@"include_checkpoint" : includeCheckpoint ? @"true" : @"false" | |
}; |
This file contains 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
module Api | |
module V2 | |
class TripInvoicesPresenter < BasePresenter | |
def initialize(trip_invoice, current_user) | |
@trip_invoice = trip_invoice | |
@current_user = current_user | |
end | |
def to_json_default | |
invoice_items = @trip_invoice.trip_invoice.trip_invoice_items.map do |item| |