Last major update: 25.08.2020
- Что такое авторизация/аутентификация
- Где хранить токены
- Как ставить куки ?
- Процесс логина
- Процесс рефреш токенов
- Кража токенов/Механизм контроля токенов
<script> | |
// массив, в котором лежат нужные нам названия UTM | |
var UTMS = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_content', 'utm_term']; | |
// функция, которая вытаскивает все GET-параметры из адресной строки | |
function findGETParameterByName(name) { | |
var result = null, tmp = []; | |
location.search.substr(1).split('&').forEach(function (item) { | |
tmp = item.split('='); | |
if (tmp[0] === name) result = decodeURIComponent(tmp[1]); |
// ... | |
// Create new validator | |
validate := utils.Validate(map[string]string{ | |
"uuid": user.ID.String(), | |
"email": user.Email, | |
"username": user.Username, | |
}) | |
// Check fields validation |
package main | |
import ( | |
"fmt" | |
"log" | |
"golang.org/x/crypto/bcrypt" | |
) | |
func main() { | |
for { |
В результате будет 2 react проекта на 1 сервере доступных по разным ссылкам
There are a lot of ways to serve a Go HTTP application. The best choices depend on each use case. Currently nginx looks to be the standard web server for every new project even though there are other great web servers as well. However, how much is the overhead of serving a Go application behind an nginx server? Do we need some nginx features (vhosts, load balancing, cache, etc) or can you serve directly from Go? If you need nginx, what is the fastest connection mechanism? This are the kind of questions I'm intended to answer here. The purpose of this benchmark is not to tell that Go is faster or slower than nginx. That would be stupid.
So, these are the different settings we are going to compare:
# Golang | |
export GOPATH="$HOME/.go" | |
export PATH="$PATH:$GOPATH/bin" |
import json | |
string_arr = ''' | |
{ | |
"user": { | |
"code": 0, | |
"data": [ | |
{ | |
"1": { | |
"row": { |
How to manually setup flake8 as PyCharm external tool | |
File / Settings / Tools / External Tools / Add | |
Name: Flake8 | |
Program: $PyInterpreterDirectory$/python | |
Parameters: -m flake8 --max-complexity 10 --ignore E501 $FilePath$ | |
Working directory: $ProjectFileDir$ | |
Output Filters / Add | |
Name: Filter 1 |