Skip to content

Instantly share code, notes, and snippets.

@bfl3tch
bfl3tch / rails_upgrade.md
Created July 26, 2022 18:48 — forked from anklos/rails_upgrade.md
Rails upgrade from 4.2 to 5.2

Overall

This documents the upgrade from Rails 4.2 to 5.2 through four parts: Backend, Frontend, Infrascture and Checkboxes

Backend

Rails update task

Run rake command rails app:update, it creates a set of new configration files for active storage, action cable, content security policy etc. As we dont use these features, the default ones from code generation are kept.

@bfl3tch
bfl3tch / regenerate_credentials.md
Created March 28, 2022 16:07 — forked from db0sch/regenerate_credentials.md
How to regenerate the master key for Rails 5.2 credentials

If your master.key has been compromised, you might want to regenerate it.

No key regeneration feature at the moment. We have to do it manually.

  1. Copy content of original credentials rails credentials:show somewhere temporarily.
  2. Remove config/master.key and config/credentials.yml.enc
  3. Run EDITOR=vim rails credentials:edit in the terminal: This command will create a new master.key and credentials.yml.enc if they do not exist.
  4. Paste the original credentials you copied (step 1) in the new credentials file (and save + quit vim)
  5. Add and Commit the file config/credentials.yml.enc
@bfl3tch
bfl3tch / rspec-syntax-cheat-sheet.rb
Created December 29, 2021 19:09 — forked from dnagir/rspec-syntax-cheat-sheet.rb
RSpec 2 syntax cheat sheet by example
# RSpec 2.0 syntax Cheet Sheet by http://ApproachE.com
# defining spec within a module will automatically pick Player::MovieList as a 'subject' (see below)
module Player
describe MovieList, "with optional description" do
it "is pending example, so that you can write ones quickly"
it "is already working example that we want to suspend from failing temporarily" do
pending("working on another feature that temporarily breaks this one")
@bfl3tch
bfl3tch / heroku-remote.md
Created September 15, 2021 00:48 — forked from randallreedjr/heroku-remote.md
Add a Heroku remote to an existing git repo

Working with git remotes on Heroku

Generally, you will add a git remote for your Heroku app during the Heroku app creation process, i.e. heroku create. However, if you are working on an existing app and want to add git remotes to enable manual deploys, the following commands may be useful.

Adding a new remote

Add a remote for your Staging app and deploy

Note that on Heroku, you must always use master as the destination branch on the remote. If you want to deploy a different branch, you can use the syntax local_branch:destination_branch seen below (in this example, we push the local staging branch to the master branch on heroku.

$ git remote add staging https://git.heroku.com/staging-app.git
@bfl3tch
bfl3tch / Rails_Checklist.md
Created August 2, 2021 17:00 — forked from ElliotOlbright/Rails_Checklist.md
Rails App checklist

Rails Database Development Checklist

Warning: This checklist does not rely on TDD to build up the rails app. It uses some MVC code snippets, so make sure to replace them with names you use on your project. Most references are from

https://backend.turing.io/module2/misc/blogger
https://github.com/turingschool-examples/task_manager_rails
  1. Create Rails Application
  • From the command line, start a new rails app. For example,
    rails new project_name -T -d="postgresql" --skip-spring --skip-turbolinks
    
@bfl3tch
bfl3tch / readme.md
Created May 17, 2021 20:25 — forked from benstr/readme.md
Gist Markdown Cheatsheet

#Heading 1 ##Heading 2 ###Heading 3 ####Heading 4 #####Heading 5 ######Heading 6


Paragraph

Checklist/Rubric

To make a copy of this rubric:

  1. Click the button in the upper right-hand corner that says Fork. This is now your copy of the document.
  2. To save your work, click the green button in the bottom right-hand corner. You can always come back and re-edit your gist.

Part I: Creating Directories and Files; Initializing Git and Pushing to GitHub

  • I named my directories correctly.