Skip to content

Latest commit

 

History

History
139 lines (98 loc) · 3.87 KB

CHEATSHEET.md

File metadata and controls

139 lines (98 loc) · 3.87 KB

Useful commands

$ rails s $ ./bin/webpack-dev-server

Env stuff

rbenv version
rbenv local 0.0.0
rbenv global 0.0.0
rbenv rehash

Database stuff

$ rbenv exec rails db:create
$ rbenv exec rails db:migrate
$ rbenv exec rails db:drop
$ rbenv exec rails db:seed
rbenv exec rails s

Updating a project

update Rubygems $ gem update --system

update bundler $ gem install bundler

update Gemfile.lock in your project $ bundler update --bundler

Add or update gems

$ bundle update
$ bundle update carrierwave
$ bundle install # after adding gem to gemfile

List app endpoints

$ rails routes

Fetch a S3 bucket

$ brew install awscli
$ aws configure
$ aws s3 sync s3://bucket-name destination/folder

Production to development

  1. Get database color (nickname)

$ heroku pg:info -a app-name $ heroku pg:pull DATABASE_COLOR pssgrs_development -a app-name

Production to staging

  1. Get database color (nickname) $ heroku pg:info -a app-name $ heroku pg:info -a app-name-staging

  2. Copy first database to the other $ heroku pg:copy appname-production::WHITE_ORIGIN_URL GOLD_DEST_DATABASE_URL -a appname-staging $ heroku pg:copy app-name::DATABASE_URL DATABASE_URL -a app-name-staging --confirm app-name-staging

AWS

Copy items to another bucket aws s3 sync s3://bucket-source s3://bucket-destination

Connect to an app shell

Here to resent confirmation instructions

$ heroku run rails c -a pssgrsv2-pr-1)
> c = User.last
> c.send_confirmation_instructions

Secrets

Edit secrets : bin/rails credentials:edit Edit secrets on heroku : $ heroku config:set SECRET_KEY_BASE=

Useful gems

  • Bullet git to kill n+1.
  • Letter Opener git to catch e-mails.

Setup tests and fixtures

JWT Authentification

Vue3 and tooling

Common packages

$ rails s
./bin/webpack-dev-server
yarn run webpack:analyze

Mapbox + Leaflet