Skip to content

Instantly share code, notes, and snippets.

View Di9's full-sized avatar

Dmitriy K Di9

View GitHub Profile
@Di9
Di9 / x.md
Created October 5, 2019 15:54 — forked from mlafeldt/x.md
Providing a Homebrew tap backed by private GitHub repo

First of all, install Homebrew itself.

As the tap is a private Git repo, you need to generate a GitHub token with repo scope and then add this token to your ~/.netrc file like this:

machine github.com
  login <your GitHub user>
  password <your GitHub token>
@Di9
Di9 / tokens.md
Created March 19, 2019 16:37 — forked from zmts/tokens.md
Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

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

Основы:

Аутентификация(authentication, от греч. αὐθεντικός [authentikos] – реальный, подлинный; от αὐθέντης [authentes] – автор) - это процесс проверки учётных данных пользователя (логин/пароль). Проверка подлинности пользователя путём сравнения введённого им логина/пароля с данными сохранёнными в базе данных.

Авторизация(authorization — разрешение, уполномочивание) - это проверка прав пользователя на доступ к определенным ресурсам.

Например после аутентификации юзер sasha получает право обращатся и получать от ресурса "super.com/vip" некие данные. Во время обращения юзера sasha к ресурсу vip система авторизации проверит имеет ли право юзер обращатся к этому ресурсу (проще говоря переходить по неким разрешенным ссылкам)

@Di9
Di9 / happy_git_on_osx.md
Created October 6, 2017 13:04 — forked from trey/happy_git_on_osx.md
Creating a Happy Git Environment on OS X

Creating a Happy Git Environment on OS X

Step 1: Install Git

brew install git bash-completion

Configure things:

git config --global user.name "Your Name"

git config --global user.email "you@example.com"

@Di9
Di9 / SwitchResX
Created March 10, 2017 20:29 — forked from erichrobinson/README.md
SwitchResX Configuration
#SwitchResX Settings for LG 21:9 UltraWide
SwitchResX is a utility that allows users to override the default resolution settings in OSX. For more information, including download links, vist http://www.madrau.com/ .
##Disabling System Integrity Protection (SIP)
If you are running OSX 10.11 or higher, SIP must be disabled. To disable SIP do the following:
- Boot into the recovery partition by pressing CMD + R when starting up your Mac.
- Once in recovery mode, open a terminal window.
- Type the command csrutil disable

Это старая версия урока, которая больше не обновляется. Новая версия расположения тут: https://github.com/codedokode/pasta/blob/master/db/patterns-oop.md


Паттерны работы с базой данных

Разберемся, как правильно с применением ООП сохранять и загружать данные из базы. Существуют такие подходы:

@Di9
Di9 / iterm2-solarized.md
Created November 21, 2016 10:51 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font (OS X / macOS)

Solarized

@Di9
Di9 / regex-japanese.txt
Created November 5, 2016 18:50 — forked from terrancesnyder/regex-japanese.txt
Regex for Japanese
Regex for matching ALL Japanese common & uncommon Kanji (4e00 – 9fcf) ~ The Big Kahuna!
([一-龯])
Regex for matching Hirgana or Katakana
([ぁ-んァ-ン])
Regex for matching Non-Hirgana or Non-Katakana
([^ぁ-んァ-ン])
Regex for matching Hirgana or Katakana or basic punctuation (、。’)