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)visit { | |
if(self.mask) { | |
self.bakedTexture = [CCRenderTexture renderTextureWithWidth:self.contentSize.width | |
height:self.contentSize.height]; | |
self.bakedTexture.position = ccp(self.contentSize.width/2,self.contentSize.height/2); | |
[self.mask setBlendFunc:(ccBlendFunc){GL_ONE, GL_ZERO}]; | |
[self.bakedTexture begin]; | |
[self.mask visit]; | |
for(CCSprite *sprite in self.assets) { |
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
def self.get_by_id(id, current_user) | |
binding.pry # ID is 1 | |
begin | |
trip_invoice = TripInvoice.find(id) | |
rescue | |
raise ServiceModelBase::RecordNotFoundError | |
end | |
raise ServiceModelBase::NotAuthorizedError unless self.has_access?(trip_invoice, current_user) |
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
// | |
// AMProgressSpinnerComponent.m | |
// AftermathCore | |
// | |
// Created by Zane Claes on 8/29/13. | |
// Copyright (c) 2013 inZania LLC. All rights reserved. | |
// | |
#import "AMProgressSpinnerComponent.h" | |
#import "AMAssetManager.h" |
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
NSDictionary *params = @{@"offset" : (offset) ? @(offset) : @0, | |
@"items_per_page" : (limit) ? @(limit) : @50, | |
@"role" : host ? @"host" : @"guest", | |
@"include_pending" : includePending ? @"true" : @"false", | |
@"include_checkpoint" : includeCheckpoint ? @"true" : @"false", | |
@"_format" : @"with_invoice_short" | |
}; | |
[[BBAPI V1] get:@"/reservations" withParams:params onSuccess:successBlock onFailure:failureBlock]; |
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
invoice_items = @trip_invoice.trip_invoice.trip_invoice_items.map do |item| | |
item.trip_product = TripProduct.find_by_id(item.trip_product_id) | |
item | |
end |
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
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| |
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
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| |
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
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 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)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 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
// | |
// 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> |