workflow:
$ rails g model NameOfModel
invoke active_record
create db/migrate/YYYYMMDDHHMMSS_create_name_of_models.rb
# -*- coding: utf-8 -*- | |
# iTC Sales Report Downloader | |
# When you run this for the first time, you'll need to enter your | |
# iTunes Connect login and vendor ID. You can find the vendor ID | |
# on the iTunes Connect website by navigating to "Sales and Trends"; | |
# it's the number next to your name (top-left). | |
CURRENCY = 'EUR' | |
RESET_LOGIN = False # Set to True to remove login from keychain |
- (void)takeControlOfTheCookies | |
{ | |
[[NSHTTPCookieStorage sharedHTTPCookieStorage] setCookieAcceptPolicy:NSHTTPCookieAcceptPolicyAlways]; | |
} | |
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
{ | |
[self takeControlOfTheCookies]; |
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
require 'grape' | |
class API < Grape::API | |
before do | |
@log_start_t = Time.now | |
Rails.logger.info " Parameters: #{params.to_hash.except("route_info")}" | |
end | |
after do | |
@log_end_t = Time.now |
BOOL MTDIsBoldTextEnabled(void) { | |
static BOOL boldTextEnabled = NO; | |
static dispatch_once_t onceToken; | |
dispatch_once(&onceToken, ^{ | |
// Hack that checks if the "bold text" flag in the accessibility settings is enabled | |
UIFont *font = [UIFont preferredFontForTextStyle:UIFontTextStyleBody]; | |
boldTextEnabled = [font.fontName rangeOfString:@"MediumP4"].location != NSNotFound; | |
}); |
docker ps | awk {' print $1 '} | tail -n+2 > tmp.txt; for line in $(cat tmp.txt); do docker kill $line; done; rm tmp.txt |
# Built application files | |
/*/build/ | |
# Crashlytics configuations | |
com_crashlytics_export_strings.xml | |
# Local configuration file (sdk path, etc) | |
local.properties | |
# Gradle generated files |
#import "UITextField+RACKeyboardSupport.h" | |
#import <ReactiveCocoa/RACEXTScope.h> | |
#import <ReactiveCocoa/NSObject+RACDescription.h> | |
@implementation UITextField (RACKeyboardSupport) | |
- (RACSignal *)rac_keyboardReturnSignal { | |
@weakify(self); | |
return [[[[RACSignal | |
defer:^{ |
This guide explains the way to setup a production server using Capistrano.
# Gemfile
# Use Capistrano for deployment