Skip to content

Instantly share code, notes, and snippets.

View iclark-stfc's full-sized avatar

iclark-stfc

View GitHub Profile
@iclark-stfc
iclark-stfc / git-cheatsheet.md
Created April 1, 2021 07:33 — forked from maff/git-cheatsheet.md
Git Cheatsheet

rebase --onto

  • we have a master
  • we have a feature branch feat-xyz
  • we do a bugfix on branch bug-abc but branched from feat-xyz instead of master and want to rebase our bugfix branch to contain only commits from master + our bugfix branch
$ (bug-abc) git rebase --onto master feat-xyz

What / Why

Deploy key is a SSH key set in your repo to grant client read-only (as well as r/w, if you want) access to your repo.

As the name says, its primary function is to be used in the deploy process in replace of username/password, where only read access is needed. Therefore keep the repo safe from the attack, in case the server side is fallen.

How to

  1. Generate a ssh key
@iclark-stfc
iclark-stfc / bash-colors.md
Created March 24, 2021 16:23 — forked from JBlond/bash-colors.md
The entire table of ANSI color codes.

Regular Colors

Value Color
\e[0;30m Black
\e[0;31m Red
\e[0;32m Green
\e[0;33m Yellow
\e[0;34m Blue
\e[0;35m Purple
@iclark-stfc
iclark-stfc / gist:108d9fed42eed0711f86c2df67cc3c86
Created March 20, 2021 17:04 — forked from cdown/gist:1163649
Bash urlencode and urldecode
urlencode() {
# urlencode <string>
old_lc_collate=$LC_COLLATE
LC_COLLATE=C
local length="${#1}"
for (( i = 0; i < length; i++ )); do
local c="${1:$i:1}"
case $c in