Skip to content

Instantly share code, notes, and snippets.

View UgRoss's full-sized avatar

Rostyslav Ugryniuk UgRoss

View GitHub Profile
@UgRoss
UgRoss / tokens.md
Created April 14, 2021 07:24 — forked from zmts/tokens.md
Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

Last major update: 25.08.2020

  • Что такое авторизация/аутентификация
  • Где хранить токены
  • Как ставить куки ?
  • Процесс логина
  • Процесс рефреш токенов
  • Кража токенов/Механизм контроля токенов
@UgRoss
UgRoss / clean_code.md
Created March 22, 2021 18:38 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

@UgRoss
UgRoss / fix-refresh-rate.sh
Created May 21, 2020 09:09
How to change refresh rate on an external display on macOS
# install homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# install cscreen
brew cask install cscreen
# list displays
cscreen -l
# find your external screen in the list and write the number (not the ID) down somewhere
# in the following instructions, use that number instead of <SCREEN>
git rm --cached -r <dir>
@UgRoss
UgRoss / git: Change old commit message.sh
Created December 4, 2019 23:36
It is bad practice to rewrite history. Do it best if no one is working on the same repository as you.
# 1. Rebase to the commit you want to change (~1 means the first ancestor of the specified commit)
git rebase -i <hash>~1
# Can also do this
git rebase -i HEAD~4 # where HEAD~4 = last 3 commits
# 2. Change pick to reword of the commit you want to change then save and quit
# 3. Change the commit message in the editor and save
git branch -a