This file contains 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
#/etc/init/<your_app>.conf | |
description "Your App" | |
author "Phamon <[email protected]>" | |
start on virtual-filesystems | |
stop on runlevel [06] | |
env PATH=/opt/www/<your_app>/current/bin:/usr/local/rbenv/shims:/usr/local/rbenv/bin:/usr/local/bin:/usr/bin:/bin | |
env RAILS_ENV=production | |
env RACK_ENV=production |
This file contains 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
class Rack::Attack | |
### Configure Cache ### | |
# If you don't want to use Rails.cache (Rack::Attack's default), then | |
# configure it here. | |
# | |
# Note: The store is only used for throttling (not blacklisting and | |
# whitelisting). It must implement .increment and .write like | |
# ActiveSupport::Cache::Store |
This file contains 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 | |
# Use at least one worker per core if you're on a dedicated server, | |
# more will usually help for _short_ waits on databases/caches. | |
worker_processes 4 | |
# Since Unicorn is never exposed to outside clients, it does not need to | |
# run on the standard HTTP port (80), there is no reason to start Unicorn | |
# as root unless it's from system init scripts. | |
# If running the master process as root and the workers as an unprivileged |
This file contains 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/deploy.rb | |
require 'mina/bundler' | |
require 'mina/rails' | |
require 'mina/git' | |
require 'mina/rbenv' | |
set :rbenv_path, '/usr/local/rbenv' | |
set :domain, '<your_ip>' | |
set :deploy_to, '<your_deploy_path>' |
This file contains 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
# /etc/nginx/sites-available/default | |
upstream symbolet { | |
server unix:/tmp/unicorn.<your_unicorn_sock>.sock fail_timeout=0; | |
} | |
server { | |
server_name symbolet.com www.symbolet.com; | |
listen 80; |
This file contains 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
doctype html | |
html | |
head | |
title | |
| Shopper2 | |
= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true | |
= javascript_include_tag 'application', 'data-turbolinks-track' => true | |
= csrf_meta_tags | |
body |
This file contains 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
$navbar-default-bg: #fff | |
$navbar-default-border: #fff | |
$border-radius-small: 1px | |
$border-radius-base: 2px | |
$border-radius-large: 3px | |
$nprogress-color: #5434B7 | |
@import 'bootstrap-compass' | |
@import 'bootstrap-sprockets' | |
@import 'bootstrap' |
This file contains 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 jquery | |
//= require jquery_ujs | |
//= require turbolinks | |
//= require bootstrap-sprockets | |
//= require nprogress | |
//= require nprogress-turbolinks | |
//= require_tree . |
This file contains 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
source 'https://rubygems.org' | |
# source 'https://rails-assets.org' | |
# ruby '2.2.3' | |
gem 'rails', '4.2.4' | |
# gem 'mysql2', '~> 0.3.13' | |
gem 'pg' | |
# js & css | |
gem 'compass-rails', '~> 2.0.1' |
This file contains 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
# train_service.rb | |
# Graph data structure is contain from, to and distance | |
class Graph | |
attr_accessor :from, :to, :distance | |
def initialize(from, to, distance) | |
@from = from | |
@to = to | |
@distance = distance.to_i | |
end |
NewerOlder