Skip to content

Instantly share code, notes, and snippets.

View koddr's full-sized avatar
🏔️
Working from the high mountains

Vic Shóstak koddr

🏔️
Working from the high mountains
View GitHub Profile
@koddr
koddr / 1_инструкция.md
Last active April 25, 2024 11:39
Буткемпы 2.0: скрипты для страниц Tilda

Для запуска лэнда для буткемпа

  1. Зайти на аккаунт тильды (it@...);
  2. Найти папку с лэндами буткемпов;
  3. Найти нужный лэндинг (там их будет два: один для главной страницы, другой для "спасибо-страницы");
  4. Разместить содержимое 2_главная_страница.html на главной странице (в самом низу страницы);
  5. Разместить содержимое 3_спасибо_страница.html на странице "спасибо" (в самом низу страницы);

❗️ Внимание! Перед размещением скриптов – необходимо проверить, нет ли уже схожего скрипта на странице. Если есть, то заменить старый скрипт на новый.

@koddr
koddr / tokens.md
Created May 21, 2021 05:31 — 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

  • Что такое авторизация/аутентификация
  • Где хранить токены
  • Как ставить куки ?
  • Процесс логина
  • Процесс рефреш токенов
  • Кража токенов/Механизм контроля токенов
@koddr
koddr / Docker-Hub-README-example.md
Created July 13, 2020 11:48
Docker Hub README example for X project (replace to yours).
// ...
// 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 {

Certbot и nginx, как обратный прокси в Docker (пример с 2 react проектами)

В результате будет 2 react проекта на 1 сервере доступных по разным ссылкам

Цели

  • Запустить nginx в одном контейнере
  • Запустить другие проекты в других контейнерах
  • Научить nginx перенаправлять запросы с разных доменов на разные проекты
  • Получить ssl сертификаты для всех проектов
@koddr
koddr / benchmark+go+nginx.md
Created November 26, 2019 09:15 — forked from hgfischer/benchmark+go+nginx.md
Benchmarking Nginx with Go

Benchmarking Nginx with Go

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:

  • Go HTTP standalone (as the control group)
  • Nginx proxy to Go HTTP
  • Nginx fastcgi to Go TCP FastCGI
  • Nginx fastcgi to Go Unix Socket FastCGI
# Golang
export GOPATH="$HOME/.go"
export PATH="$PATH:$GOPATH/bin"
@koddr
koddr / get_keys_in_first_level.py
Created April 2, 2019 08:35
Python: JSON only get keys in first level
import json
string_arr = '''
{
"user": {
"code": 0,
"data": [
{
"1": {
"row": {
@koddr
koddr / Flake8.txt
Created March 24, 2019 08:32 — forked from tossmilestone/Flake8.txt
Flake8 integrated with PyCharm
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