Skip to content

Instantly share code, notes, and snippets.

@4096void
Last active November 15, 2022 08:52
Show Gist options
  • Select an option

  • Save 4096void/eb8f3f33a1c75c87d2b457d00919ccad to your computer and use it in GitHub Desktop.

Select an option

Save 4096void/eb8f3f33a1c75c87d2b457d00919ccad to your computer and use it in GitHub Desktop.
google search cache for TJ's FAQs
  • get my Mac's RSA public key, pbcopy < ~/.ssh/id_rsa.pub

GR III

  • move files if destination does not exists, mv -vn from_dir/**.JPG to_dir
  • rename files, find . -depth -name "*.JPG" -exec sh -c 'f="{}"; mv -- "$f" "${f%.JPG}_1.JPG"' \;

Git

  • delete a branch locally and remotely, git branch -d ${local_branch} && git push orogin -d ${remote_branch}
  • create local branch in git then push it to remote, git checkout -b <branch> && git push -u origin <branch>
  • push to another url, git remote set-url origin <new_url>
  • revert last commit then push it to remote, git reset --hard head~1 && git push -f origin

Readline

  • previous(next) one in history, ctrl + p(n)
  • move, ctrl + a(|<-), alt + b(<<), ctrl + b(<), ctrl + f(>), alt + f(>>) ctrl + e(->|)
  • delete, ctrl + u(to beginning), ctrl + w(one word before), alt + d(one word after), ctrl + k(to end)

note taking

  • items
    • -, without theme one(s)
    • ##, under certain theme(s)
    • file, respect to certain range of time / space / anythings, I guess
  • import things stay by just REVIEW AND COPY into new places
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment