Skip to content

Instantly share code, notes, and snippets.

View ajib6ept's full-sized avatar
🏠
Working from home

Альберт ajib6ept

🏠
Working from home
  • Russia
  • 15:31 (UTC +03:00)
View GitHub Profile
@ajib6ept
ajib6ept / .pre-commit-config.yaml
Last active March 12, 2023 09:45
Base pre-commit config file #config
ci:
autofix_prs: false
autoupdate_schedule: monthly
submodules: false
repos:
- repo: meta
hooks:
- id: check-hooks-apply
- id: check-useless-excludes
@ajib6ept
ajib6ept / help.md
Last active March 5, 2023 09:37
Redis #mynotes

key-value хранилище

Запись новой сессии

127.0.0.1:6379> set session:1 120

Получение существующей сессии

127.0.0.1:6379> get session:1

- hosts: webservers
gather_facts: no
tasks:
- debug:
msg: "{{ item }} + {{ item }}@test.com"
with_items:
- "{{ users }}"
# BEGIN
def find_where(items, search_request):
# Значение object() в качестве умолчательного используется для того,
# чтобы не получилось получить от get значение None и случайно
# успешно сравнить с value == None.
# Каждое значение object() всегда равно только самому себе.
default = object()
for item in items:
for key, value in search_request.items():
# Здесь можно было бы использовать
@ajib6ept
ajib6ept / poetry.py
Last active March 5, 2023 09:38
poetry #mynotes
poetry config virtualenvs.in-project true
poetry config --list
# Basic usage
# let's create our new project
$ poetry new poetry-demo
# add dependencies
@ajib6ept
ajib6ept / 1.py
Last active March 5, 2023 09:38
telegram - create bot #example
import requests
# import pysocks
proxies = {
'http': 'socks5://127.0.0.1:9050',
'https': 'socks5://127.0.0.1:9050'
}
r = requests.get('https://web.telegram.org/', proxies=proxies)
How To Share Data Between the Docker Container and the Host
$ docker run --name=nginx -d -v ~/nginxlogs:/var/log/nginx -p 5000:80 nginx
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
PROXY = 'socks5://127.0.0.1:9050'
def main():
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
def main():
chrome_options = Options()
import asyncio
import time
from pyppeteer import launch
from urllib.parse import urlparse
WEBSITE_LIST = [
'http://www.python.org',
'http://www.python.org/about/',
'http://www.onlamp.com/pub/a/python/2003/04/17/metaclasses.html',