Skip to content

Instantly share code, notes, and snippets.

View vladvinnikov's full-sized avatar

Vladimir Vinnikov vladvinnikov

View GitHub Profile
@vladvinnikov
vladvinnikov / readme.md
Created September 22, 2018 17:31 — forked from maxivak/readme.md
Integrating Gem/Engine and Main Rails App
#!/bin/bash
#
# Author: Josh Frye <joshfng>
# Licence: MIT
#
# Contributions from: Wayne E. Seguin <[email protected]>
#
# To run:
# sudo apt-get -y install curl && curl https://github.com/joshfng/railsready/raw/master/railsready.sh >> railsready.sh && chmod a+x railsready.sh && ./railsready.sh
# The script will ask if you want to build Ruby from source or install RVM
AllCops:
Exclude:
- 'bin/**/*'
- 'db/schema.rb'
- 'tmp/**/*'
- 'vendor/**/*'
- 'autotests/**/*'
Metrics/LineLength:
Max: 100
inherit_from: .rubocop_todo.yml
AllCops:
Exclude:
- 'bin/*'
- 'db/schema.rb'
- 'tmp/**/*'
- 'vendor/**/*'
RunRailsCops: true
Documentation:
Enabled: false
#!/usr/bin/env bash
mkdir /var/app/ondeck/vendor /var/app/ondeck/public /var/app/support/bundle /var/app/support/assets /var/app/support/cache
ln -s /var/app/support/bundle /var/app/ondeck/vendor
ln -s /var/app/support/assets /var/app/ondeck/public
ln -s /var/app/support/cache /var/app/ondeck/vendor
sed -i 's/"rake/"bundle exec rake/' /opt/elasticbeanstalk/hooks/appdeploy/pre/11_asset_compilation.sh
# this is a dirty implementation of logger that
# compiles AR queries with trace into /last_request_log.html
# the snippet is useful when optimizing performance of the endpoint
class QueryLogSubscriber < ActiveSupport::LogSubscriber
TRACE_LEVEL = :app
LINES = 5
IGNORE_CACHED_QUERIES = false
def initialize
@vladvinnikov
vladvinnikov / 0000_packages.config
Last active August 29, 2015 14:25 — forked from kpheasey/0000_packages.config
AWS Elastic Beanstalk Ruby 2.2 Puma Sidekiq
packages:
yum:
git: []
htop: []
@vladvinnikov
vladvinnikov / 0000_packages.config
Last active August 29, 2015 14:25 — forked from gcarrion-gfrmedia/0000_packages.config
AWS Elastic Beanstalk Ruby 2.0/Puma Environment - .ebextensions tweaks and Sidekiq configuration. This is known to work fine with AWS Elastic Beanstalk 's 64bit Amazon Linux 2014.03 v1.0.1 running Ruby 2.0 (Puma) stack. Later stack versions might not work, but for that specific version works fine.
# Install Git needed for Git based gems
packages:
yum:
git: []
https://github.com/orgsync/active_interaction
https://github.com/cypriss/mutations
https://github.com/krisleech/wisper
@vladvinnikov
vladvinnikov / puma.rb
Last active August 29, 2015 14:13 — forked from catsby/puma.rb
preload_app!
min_threads = Integer(ENV['MIN_THREADS'] || 0)
max_threads = Integer(ENV['MAX_THREADS'] || 5)
threads min_threads, max_threads
workers Integer(ENV['WORKER_COUNT'] || 3 )
on_worker_boot do
ActiveSupport.on_load(:active_record) do