Skip to content

Instantly share code, notes, and snippets.

View Manimall's full-sized avatar
🤨
I don't know who to trust, no surprise...

Max Manimall

🤨
I don't know who to trust, no surprise...
View GitHub Profile
@Manimall
Manimall / tokens.md
Created July 6, 2018 05:07 — forked from zmts/tokens.md
Про токены, JSON Web Tokens (JWT), аутентификацию и авторизацию. Token-Based Authentication

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

Preconditions:

В данной заметке рассматривается работа JWT с симметичным алгоритмом шифрования (HS256/HS384/HS512)

Основы:

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

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

@Manimall
Manimall / 0.md
Created May 15, 2018 09:20 — forked from max-mapper/0.md
JS hoisting by example

JavaScript function hoisting by example

Below are many examples of function hoisting behavior in JavaScript. Ones marked as works successfuly print 'hi!' without errors.

To play around with these examples (recommended) clone them with git and execute them with e.g. node a.js

Notes on hoisting

(I may be using incorrect terms below, please forgive me)

@Manimall
Manimall / plural.js
Created May 4, 2018 21:49 — forked from tomfun/plural.js
JavaScript russian plural function
function getNoun(number, one, two, five) {
let n = Math.abs(number);
n %= 100;
if (n >= 5 && n <= 20) {
return five;
}
n %= 10;
if (n === 1) {
return one;
}
@Manimall
Manimall / 1.css
Created May 3, 2018 09:41 — forked from meritt/1.css
input:valid {
border-color: green;
}
input:invalid {
border-color: red;
}
@Manimall
Manimall / button.sass
Created January 27, 2018 08:34 — forked from agragregra/button.sass
Button Sass Styles (Universal Starter)
.button
display: inline-block
border: none
color: #fff
text-decoration: none
background-color: $accent
padding: 15px 45px
font-size: 13px
text-transform: uppercase
font-weight: 600