- Buy a domain and map a
CNAMEto your Heroku app. Usewww.example.com, notexample.com - Register to Uptime Robot and set up a monitor on your website (keeps dyno alive!)
- Use Unicorn as the Webserver
- Add the Heroku add-on PG Backups with automatic backups and monthly retention
- Install NewRelic (provision the add-on and skip to the Ruby section)
- Add SPF and DKIM records to your Mandrill account if you send email with @yourdomain.com
- If your website uses Devise, buy a SSL certificate and set it up to get a
https://URL. Otherwise passwords are in cl
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
| <!-- app/views/layouts/application.html.erb --> | |
| <!-- [...] --> | |
| <script src="//maps.google.com/maps/api/js?sensor=false" type="text/javascript"></script> | |
| <script src="//google-maps-utility-library-v3.googlecode.com/svn/tags/markerclustererplus/2.0.14/src/markerclusterer_packed.js" type="text/javascript"></script> | |
| <%= javascript_include_tag "application" %> | |
| <%= yield(:js) %> | |
| </body> |
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
| source "https://rubygems.org" |
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
| def sum_odd_indexed(array) | |
| # TODO: computes the sum of elements at odd indices (1, 3, 5, 7, etc.) | |
| # You should make use Enumerable#each_with_index | |
| end | |
| def even_numbers(array) | |
| # TODO: Return the even numbers from a list of integers. | |
| # You should use Enumerable#select | |
| 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
| def correct?(users_guess,computer_number) | |
| return computer_number == users_guess | |
| 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
| require 'sinatra' | |
| require 'sinatra/reloader' | |
| require_relative "cookbook" | |
| filename = "recipes.csv" | |
| cookbook = Cookbook.new(filename) | |
| get '/' do | |
| @recipes = cookbook.all |
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
| pkill -f rails | |
| launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist | |
| brew update | |
| brew upgrade postgresql | |
| initdb /usr/local/var/postgres9.4 -E utf8 | |
| pg_upgrade -v \ | |
| -d /usr/local/var/postgres \ | |
| -D /usr/local/var/postgres9.4 \ | |
| -b /usr/local/Cellar/postgresql/9.3.5_1/bin/ \ | |
| -B /usr/local/Cellar/postgresql/9.4.1/bin/ |
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
| echo "web: bundle exec puma -C config/puma.rb" > Procfile | |
| curl -L https://gist.githubusercontent.com/ssaunier/24bc1c4db955c19e3289/raw/puma.rb > config/puma.rb |
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
| # app/controllers/hello_sign_webhooks_controller.rb | |
| require 'openssl' unless defined?(OpenSSL) | |
| class HelloSignWebhooksController < ApplicationController | |
| class InvalidSignature < StandardError; end | |
| before_action :parse_params | |
| before_action :check_event_hash! | |
| def create |
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 ruby | |
| url_matcher = %r{REDISCLOUD_URL:\s*redis://rediscloud:(\w+)@([\w\-.]+):(\d+)} | |
| env_string = `heroku config | grep REDISCLOUD_URL` | |
| env_settings = env_string.split('\n') | |
| match_data = url_matcher.match(env_settings[0]) | |
| db = ARGV[0] || 0 |