sudo apt install \
autoconf \
bison \
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
| ########## Install NGINX ############## | |
| # Install software-properties-common package to give us add-apt-repository package | |
| sudo apt-get install -y software-properties-common | |
| # Install latest nginx version from community maintained ppa | |
| sudo add-apt-repository ppa:nginx/stable | |
| # Update packages after adding ppa |
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
| upstream my_app { | |
| server unix:///var/run/puma/my_app.sock; | |
| } | |
| server { | |
| listen 80; | |
| server_name _ localhost; # need to listen to localhost for worker tier | |
| location / { | |
| proxy_pass http://my_app; # match the name of upstream directive which is defined above |
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
| # ElasticSearch upstart script | |
| description "ElasticSearch service" | |
| start on (net-device-up | |
| and local-filesystems | |
| and runlevel [2345]) | |
| stop on runlevel [016] |
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
| # Here's what you can do with this capistrano setup: | |
| # > cap staging deploy:setup | |
| # > cap staging deploy | |
| # (create your database by hand) | |
| # > cap staging deploy:migrate | |
| # this is specific to my app because my fixtures are my seeds :( | |
| # > cap staging fixtures | |
| # same commands above with production: |
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 'sprockets' | |
| require 'uglifier' | |
| require 'logger' | |
| namespace :website do | |
| desc "remove files in output directory" | |
| task :clean do | |
| puts "Removing output..." | |
| Dir["html/*"].each { |f| rm_rf(f) } |
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 'carrierwave/processing/mini_magick' | |
| class ImageUploader < CarrierWave::Uploader::Base | |
| include CarrierWave::MiniMagick | |
| IMAGE_EXTENSIONS = %w(jpg jpeg gif png) | |
| DOCUMENT_EXTENSIONS = %w(exe pdf doc docm xls) | |
| def store_dir | |
| "files/#{model.id}" |
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
| puts "\033[1;31m=> Loading hacks: #{__FILE__}\033[0m" | |
| module BeforeFilterHacks | |
| def self.included(base) | |
| base.class_eval { alias_method_chain :call, :hacks } | |
| end | |
| def call_with_hacks(controller, &block) | |
| message= if method.kind_of?(Proc) | |
| method.to_s |