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
| GIT | |
| remote: https://github.com/TalentBox/sequel-rails.git | |
| revision: 402466ff6fad9f27b7b8eeb58611ada96d18dcc0 | |
| branch: master | |
| specs: | |
| sequel-rails (1.0.0) | |
| actionpack (>= 4.0.0) | |
| activemodel (>= 4.0.0) | |
| railties (>= 4.0.0) | |
| sequel (>= 3.28, < 6.0) |
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
| require "active_record" | |
| ActiveRecord::Base.establish_connection('postgres:///testing') | |
| ActiveRecord::Migration.verbose = false | |
| ActiveRecord::Migration.class_eval do | |
| create_table :played_quizzes, force: true do |t| | |
| t.integer :player_ids, array: true | |
| t.json :quiz_snapshot | |
| 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
| # config/unicorn.rb | |
| worker_processes Integer(ENV["WEB_CONCURRENCY"] || 3) | |
| timeout 60 | |
| preload_app true | |
| before_fork do |server, worker| | |
| Signal.trap 'TERM' do | |
| puts 'Unicorn master intercepting TERM and sending myself QUIT instead' | |
| Process.kill 'QUIT', Process.pid | |
| 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
| # Plain Ol' Node | |
| node --max-old-space-size=1024 app.js # increase to 1gb | |
| node --max-old-space-size=2048 app.js # increase to 2gb | |
| node --max-old-space-size=3072 app.js # increase to 3gb | |
| node --max-old-space-size=4096 app.js # increase to 4gb | |
| node --max-old-space-size=5120 app.js # increase to 5gb | |
| node --max-old-space-size=6144 app.js # increase to 6gb | |
| # For pm2 | |
| pm2 start app.js --node-args="--max-old-space-size=1024" # increase to 1gb |
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
| # Nginx+Unicorn best-practices congifuration guide. Heartbleed fixed. | |
| # We use latest stable nginx with fresh **openssl**, **zlib** and **pcre** dependencies. | |
| # Some extra handy modules to use: --with-http_stub_status_module --with-http_gzip_static_module | |
| # | |
| # Deployment structure | |
| # | |
| # SERVER: | |
| # /etc/init.d/nginx (1. nginx) | |
| # /home/app/public_html/app_production/current (Capistrano directory) | |
| # |
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
| # unicorn_rails -c /data/github/current/config/unicorn.rb -E production -D | |
| rails_env = ENV['RAILS_ENV'] || 'production' | |
| # 16 workers and 1 master | |
| worker_processes (rails_env == 'production' ? 16 : 4) | |
| # Load rails+github.git into the master before forking workers | |
| # for super-fast worker spawn times | |
| preload_app true |
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
| # to generate your dhparam.pem file, run in the terminal | |
| openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
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
| # to generate your dhparam.pem file, run in the terminal | |
| openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
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
| # config/locales/en.yml | |
| en: | |
| exception: | |
| show: | |
| not_found: | |
| title: "Not Found" | |
| description: "The page you were looking for does not exists." | |
| internal_server_error: | |
| title: "Internal Server Error" |
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
| #!/usr/bin/env python | |
| # -*- coding: utf-8 -*- | |
| class Color(object): | |
| """ | |
| reference from https://gist.github.com/Jossef/0ee20314577925b4027f and modified bit. | |
| """ | |
| def __init__(self, text, **user_styles): |