Skip to content

Instantly share code, notes, and snippets.

View ravishrivastava's full-sized avatar

Ravi Shrivastava ravishrivastava

View GitHub Profile
@ravishrivastava
ravishrivastava / mysql.database.yml
Created September 22, 2018 07:21 — forked from mmizutani/mysql.database.yml
Sample config/database.yml from Rails. Postgres, MySQL, and SQLite
#
# Install the MYSQL driver
# gem install mysql2
#
# Ensure the MySQL gem is defined in your Gemfile
# gem 'mysql2'
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@ravishrivastava
ravishrivastava / application_controller.rb
Created August 10, 2017 07:58 — forked from seangaffney/application_controller.rb
Setting mailer path in Rails 3
class ApplicationController < ActionController::Base
protect_from_forgery
before_filter :mailer_set_url_options
def mailer_set_url_options
ActionMailer::Base.default_url_options[:host] = request.host_with_port
end
end