Skip to content

Instantly share code, notes, and snippets.

View epintozzi's full-sized avatar

Erin Pintozzi epintozzi

View GitHub Profile
@JStans12
JStans12 / gist:86963b733db3060ed276f35447615253
Last active January 6, 2017 03:17
Rails_The_Way_I_Like_it

Generate a new project without the included testing and with a postgres database:

rails new MyApp -T --database=postgresql

Add rspec, capybara, factory_girl, launchy and database cleaner to gemfile:

group :development, :test do
  gem 'rspec-rails'
  gem 'capybara'
@rwarbelow
rwarbelow / running_app_in_production_locally.markdown
Created November 11, 2015 18:26
How to Run a Rails App in Production Locally
  1. Add gem 'rails_12factor' to your Gemfile. This will add error logging and the ability for your app to serve static assets.
  2. bundle
  3. Run RAILS_ENV=production rake db:create db:migrate db:seed
  4. Run rake secret and copy the output
  5. From the command line: export SECRET_KEY_BASE=output-of-rake-secret
  6. To precompile your assets, run rake assets:precompile. This will create a folder public/assets that contains all of your assets.
  7. Run RAILS_ENV=production rails s and you should see your app.

Remember to clobber your assets (rake assets:clobber) and re-precompile (rake assets:precompile) if you make changes.

@jagregory
jagregory / gist:710671
Created November 22, 2010 21:01
How to move to a fork after cloning
So you've cloned somebody's repo from github, but now you want to fork it and contribute back. Never fear!
Technically, when you fork "origin" should be your fork and "upstream" should be the project you forked; however, if you're willing to break this convention then it's easy.
* Off the top of my head *
1. Fork their repo on Github
2. In your local, add a new remote to your fork; then fetch it, and push your changes up to it
git remote add my-fork [email protected]