Skip to content

Instantly share code, notes, and snippets.

View yarickprih's full-sized avatar

Yaroslav Prykhodko yarickprih

View GitHub Profile
@pmbrull
pmbrull / singledispatch_01.py
Created March 15, 2022 17:25
How to make the most of Pydantic 07
from functools import singledispatch
@singledispatch
def process(model):
"""
Default processing definition
"""
raise NotImplementedError(f"I don't know how to process {type(model)}")
@process.register
Создание пользователя
---------------------
adduser username
usermod -aG sudo username
group username
su username
---------------------------------------
Компиляции python 3.6
----------------------
sudo apt-get install -y make build-essential libssl-dev zlib1g-dev
@nrollr
nrollr / nginx.conf
Last active April 22, 2024 15:11
NGINX config for SSL with Let's Encrypt certs
# UPDATED 17 February 2019
# Redirect all HTTP traffic to HTTPS
server {
listen 80;
listen [::]:80;
server_name www.domain.com domain.com;
return 301 https://$host$request_uri;
}
# SSL configuration
@cecilemuller
cecilemuller / letsencrypt_2020.md
Last active April 15, 2024 02:19
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

@parmentf
parmentf / GitCommitEmoji.md
Last active May 5, 2024 13:32
Git Commit message Emoji
@bootsified
bootsified / google_map_multiple_markers_geocoding.html
Last active April 5, 2021 12:57
Google Map with multiple markers - Geocoded addresses, unique InfoWindows, and automatic zoom and centering to show all markers. Working demo here: https://codepen.io/bootsified/details/XWbgwNr
<!--
* GOOGLE MAP W/ MULTIPLE MARKERS AND OPTIONAL GEOCODING
* by Boots (www.boots.media)
* Working demo here: https://codepen.io/bootsified/details/XWbgwNr
*
* To use geocoding for locations, set `useGeocoding = true;` (limit 10 locations).
* To manually place markers by lat/lng, set `useGeocoding = false;` (no limit). Locations array must contain lat/lng data.
-->
<script src="https://maps.googleapis.com/maps/api/js?key=[YOUR_APP_KEY_GOES_HERE]"></script>
@plentz
plentz / nginx.conf
Last active April 24, 2024 11:15
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048