Skip to content

Instantly share code, notes, and snippets.

View willdowglas's full-sized avatar

Will Douglas willdowglas

View GitHub Profile
@willdowglas
willdowglas / KB-Buying-guide-EU.md
Created October 19, 2022 20:47 — forked from henfiber/KB-Buying-guide-EU.md
Buying keyboards and keyboard components from EU

Europe

@willdowglas
willdowglas / regenerate_credentials.md
Created December 30, 2020 14:06 — 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
@willdowglas
willdowglas / bootstrap-memo.md
Created August 29, 2019 19:22 — forked from yalab/bootstrap-memo.md
rails5 + webpacker + bootstrap
$ echo 'gem "webpacker"' >> Gemfile
$ bundle install
$ rails webpacker:install
$ yarn add [email protected] jquery popper.js
diff --git a/config/webpack/environment.js b/config/webpack/environment.js
index d16d9af..86bf1a7 100644
@willdowglas
willdowglas / revert-a-commit.md
Created August 29, 2019 01:19 — forked from gunjanpatel/revert-a-commit.md
Git HowTo: revert a commit already pushed to a remote repository

Revert the full commit

Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.

git revert {commit_id}'

About History Rewriting

Delete the last commit

Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32:

@willdowglas
willdowglas / heroku_pg_db_reset.md
Created April 1, 2019 14:25 — forked from zulhfreelancer/heroku_pg_db_reset.md
How to reset PG Database on Heroku?

Reset PG Database on Heroku

  • Step 1: heroku restart
  • Step 2: heroku pg:reset DATABASE (no need to change the DATABASE)
  • Step 3: heroku run rake db:migrate
  • Step 4: heroku run rake db:seed (if you have seed)

One liner

heroku restart; heroku pg:reset DATABASE --confirm APP-NAME; heroku run rake db:migrate

@willdowglas
willdowglas / ubuntu_agnoster_install.md
Created February 13, 2019 18:21 — forked from renshuki/ubuntu_agnoster_install.md
Ubuntu 16.04 + Terminator + Oh My ZSH with Agnoster Theme

Install Terminator (shell)

sudo add-apt-repository ppa:gnome-terminator
sudo apt-get update
sudo apt-get install terminator

Terminator should be setup as default now. Restart your terminal (shortcut: "Ctrl+Alt+T").

Install ZSH