Skip to content

Instantly share code, notes, and snippets.

View bleonard's full-sized avatar

Brian Leonard bleonard

View GitHub Profile
#include "Pods/Target Support Files/Pods/Pods.staging.xcconfig"
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) kEnvironment="@\"staging\""
RCT_EXPORT_METHOD(get:(RCTResponseSenderBlock)callback)
{
NSString *locale = [[NSLocale currentLocale] localeIdentifier];
locale = [locale stringByReplacingOccurrencesOfString:@"_" withString:@"-"];
NSNumber * simulator = @NO;
NSString * version = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleShortVersionString"];
NSString * buildCode = [[NSBundle mainBundle] objectForInfoDictionaryKey:(NSString *)kCFBundleVersionKey];
NSString * envName = kEnvironment;
Model.prototype.getApiHost = function() {
switch(this.data.name) {
case 'test':
return 'http://localhost:3001';
case 'debug':
return 'http://localhost:3000';
case 'staging':
return 'https://someday.herokuapp.com';
default:
throw("Unknown Environment.getApiHost: " + this.data.name);
#if TARGET_IPHONE_SIMULATOR
jsCodeLocation = [NSURL URLWithString:@"http://localhost:8081/index.ios.bundle?platform=ios"];
#else
jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
#endif
if [ "${PLATFORM_NAME}" != "iphonesimulator" ]; then
source ~/.nvm/nvm.sh
cd ${PROJECT_DIR}/.. && react-native bundle --minify
fi
+----------------------+-------+-------+---------+---------+-----+-------+
| Name | Lines | LOC | Classes | Methods | M/C | LOC/M |
+----------------------+-------+-------+---------+---------+-----+-------+
| Controllers | 1848 | 1483 | 32 | 174 | 5 | 6 |
| Helpers | 2257 | 1892 | 45 | 245 | 5 | 5 |
| Jobs | 399 | 295 | 11 | 33 | 3 | 6 |
| Models | 4584 | 3509 | 61 | 526 | 8 | 4 |
| Observers | 42 | 22 | 2 | 5 | 2 | 2 |
| Libraries | 2987 | 2272 | 30 | 287 | 9 | 5 |
| Configuration | 1233 | 669 | 4 | 17 | 4 | 37 |
def show
@hash = Api::V1::UserHash.show(@user, params)
render json: @hash
end
class Task < ActiveRecord::Base
include Rabbit::HasMoney
include Rabbit::HasVehicles
include Rabbit::StateTransition
include Rabbit::WithGeography
include Rabbit::Cached
include Task::Properties
include Task::MultiLocation
include Task::TaskProgress
class Task < ActiveRecord::Base
ajaxful_rateable :stars => 5, :dimensions => [:poster, :tasker]
end
class Rate < ActiveRecord::Base
belongs_to :task
belongs_to :ratee, :class_name => "User"
belongs_to :rater, :class_name => "User"
end