Skip to content

Instantly share code, notes, and snippets.

View b2r2's full-sized avatar
๐Ÿ‘‹

Ramil Kuvatov b2r2

๐Ÿ‘‹
View GitHub Profile
@b2r2
b2r2 / example.com.conf
Created August 7, 2019 17:42 — forked from ufth/example.com.conf
ะฑะตะทะพะฟะฐัะฝั‹ะน ะบะพะฝั„ะธะณ nginx ะดะปั wordpress ั php-fpm chroot
# /etc/nginx/sites-available/example.com.conf
# if you find this config useful, please consider donating bitcoin:1MjxPWAyebHhjQdjLPGcV5oZd5VbEWrAga
# ะฐ ัั‚ะพ ัƒะถะต ะฝะตะฟะพัั€ะตะดัั‚ะฒะตะฝะฝะพ ัะฐะผ ั„ะฐะนะป ะฒะธั€ั‚ัƒะฐะปัŒะฝะพะณะพ ั…ะพัั‚ะฐ
# ั€ะฐะทั€ะตัˆะฐะตะผ 30 ะทะฐะฟั€ะพัะพะฒ ะทะฐ 60 ัะตะบัƒะฝะด ั ะพะดะฝะพะณะพ ip
# ัั‚ะพั‚ ะฟะฐั€ะฐะผะตั‚ั€ ั€ะฐะฑะพั‚ะฐะตั‚ ะบะฐะบ ะพะณั€ะฐะฝะธั‡ะตะฝะธะต ัะบะพั€ะพัั‚ะธ ะบะผ/ั‡ ะฝะฐ ะทะฝะฐะบะต,
# *ะฝะตะปัŒะทั* ัะดะตะปะฐั‚ัŒ 30 ะทะฐะฟั€ะพัะพะฒ ะทะฐ ะฝะตัะบะพะปัŒะบะพ ัะตะบัƒะฝะด ะธ ะถะดะฐั‚ัŒ ัะปะตะดัƒัŽั‰ะตะน ะผะธะฝัƒั‚ั‹
# ั‚ะฐะบะฐั ะทะฐะฟะธััŒ ัะบะฒะธะฒะฐะปะตะฝั‚ะฝะฐ ั€ะฐะทั€ะตัˆั‘ะฝะฝะพะน ัะบะพั€ะพัั‚ะธ ะฒ 0.5 ะทะฐะฟั€ะพัะฐ ะฒ ัะตะบัƒะฝะดัƒ
limit_req_zone $binary_remote_addr zone=login_user:1m rate=30r/m;
#### COLOUR (Solarized 256)
# default statusbar colors
set-option -g status-bg colour235 #base02
set-option -g status-fg colour136 #yellow
set-option -g status-attr default
# default window title colors
set-window-option -g window-status-fg colour244 #base0
set-window-option -g window-status-bg default
"=====================================================
" Vundle settings
"=====================================================
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim' " let Vundle manage Vundle, required
"---------=== Code/project navigation ===-------------
"=====================================================
" Vundle settings
"=====================================================
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'gmarik/Vundle.vim' " let Vundle manage Vundle, required
"---------=== Code/project navigation ===-------------
@b2r2
b2r2 / tmux-cheats.md
Created November 7, 2018 20:14 — forked from Starefossen/tmux-cheats.md
My personal tmux cheat sheet for working with sessions, windows, and panes. `NB` I have remapped the command prefix to `ctrl` + `a`.

Sessions

New Session

  • tmux new [-s name] [cmd] (:new) - new session

Switch Session

  • tmux ls (:ls) - list sessions
  • tmux switch [-t name] (:switch) - switches to an existing session
import json
from time import sleep
import requests
from bs4 import BeautifulSoup
def parse(u):
title = '-'
submit_by = '-'
description = '-'
calories = 0
ingredients = []
"mappings": {
"salads": {
"dynamic": "strict",
"properties": {
"title": {
"type": "text"
},
"submitter": {
"type": "text"
},
{'_shards': {'failed': 0, 'skipped': 0, 'successful': 1, 'total': 1},
'hits': {'hits': [{'_id': 'YkTAuGMBzBKRviZYEDdu',
'_index': 'recipes',
'_score': 1.0,
'_source': {'calories': '102',
'description': "I've been making variations of "
'this salad for years. I '
'recently learned how to '
'massage the kale and it makes '
'a huge difference. I had a '
from collections import defaultdict
def get_graph(s):
graph = defaultdict(set)
for i in range(int(s[0]), int(s[2]) + 1):
for j in range(int(s[1]), int(s[3]) + 1):
key = str(i) + str(j)
left_node = int(key) + 1
right_node = int(key) + 10
if left_node // 10 <= int(s[2]) and left_node % 10 <= int(s[2]):
graph[key].add(str(left_node))
from collections import defaultdict
def get_graph(s):
graph = defaultdict(set)
for i in range(int(s[0]), int(s[2]) + 1):
for j in range(int(s[1]), int(s[3]) + 1):
key = str(i) + str(j)
left_node = int(key) + 1
right_node = int(key) + 10
if left_node // 10 <= int(s[2]) and left_node % 10 <= int(s[2]):
graph[key].add(str(left_node))