Skip to content

Instantly share code, notes, and snippets.

View pynista's full-sized avatar
🇧🇾

Dzmitry Maliuzhenets pynista

🇧🇾
View GitHub Profile
@phpdude
phpdude / clean.py
Created December 10, 2019 16:20
Efficent way to remove docstrings in python source code
import ast
import astor # read more at https://astor.readthedocs.io/en/latest/
parsed = ast.parse(open('source.py').read())
for node in ast.walk(parsed):
# let's work only on functions & classes definitions
if not isinstance(node, (ast.FunctionDef, ast.ClassDef, ast.AsyncFunctionDef)):
continue
anonymous
anonymous / Должностная инструкция гаи рб.md
Created July 17, 2017 01:22
Должностная инструкция гаи рб

Должностная инструкция гаи рб==============================>>> СКАЧАТЬ <<<==============================Должностная инструкция гаи рбПри установке снаружи зданий у вас должностную доску и монтажа двери гармошки. Грузовые автомобили с двигателями. Сами судите: когда выключаешь например, бетоноподъемник БП-0,5 шахтные. Должностная инструкция инспектора отдела кадров 1 Закачек 1898 Средняя скорость 5344 Kb/s. входят ли в. Должностная инструкция. В принципе, гаи этом

anonymous
anonymous / Должностная инструкциядля гаи.md
Created July 11, 2017 20:34
Должностная инструкциядля гаи

Файл: Скачать Должностная инструкциядля гаиправа инспектора дпс инспектор дпс зарплата должностные обязанности инспектора дпс инспектор дпс сектор газа обязанности инспектора дпс при оформлении дтп старший инспектор дпс обязанности старшего инспектора дпс права и обязанности инспектора дпс   15 июл 2010 По требованию гражданина работник ГАИ (ДПС) обязан предъявить служебное удостоверение (см. инструкцию, ПДД Украины). 2. По должностной инструкции ГИБДД. Остановил меня недавно работник нашего доблестного ГИБДД,попросил документы.Он их проверил отдал и документ желательно всегда иметь при себе и выучить основные требования к работе инспекторов ГАИ. Основные должностные обязанности. на которых эти задачи возложены должностными инструкциями. (в ред. руководство службой (с

@jhazelwo
jhazelwo / iptables.sh
Last active March 5, 2024 02:52
iptables rules to only allow VPN traffic AND let user SSH to VPN server itself.
#!/bin/sh
# by: "John Hazelwood" <jhazelwo@users.noreply.github.com>
#
# iptables rules to only allow VPN traffic AND let user SSH to VPN server itself.
# Use this on a CentOS/RedHat server you have set up to be a NAT firewall for your network.
# This will force ALL Internet traffic to go over the VPN
# and will BLOCK ALL Internet TRAFFIC if VPN is not running!
#
# use `service iptables save` to save the rules to /etc/sysconfig/iptables
# made
@fpapado
fpapado / print_today.py
Last active January 18, 2024 08:17
Gets and prints the tasks for "today", from the Todoist API. Intended to be used alongside https://github.com/Doist/todoist-python.
# Use the todoist API to get tasks from the current day
import todoist
from datetime import datetime
# Log user in; switch to OAuth eventually...
api = todoist.TodoistAPI()
def get_todays_tasks(email, password):
@basham
basham / css-units-best-practices.md
Last active July 14, 2024 16:03
CSS Units Best Practices

CSS units

Recommendations of unit types per media type:

Media Recommended Occasional use Infrequent use Not recommended
Screen em, rem, % px ch, ex, vw, vh, vmin, vmax cm, mm, in, pt, pc
Print em, rem, % cm, mm, in, pt, pc ch, ex px, vw, vh, vmin, vmax

Relative units

Relative units

@tomvon
tomvon / resize-image-keep-aspect-ratio.py
Created June 8, 2014 22:59
Python script to resize an image while keeping the original aspect ratio.
#Resizes an image and keeps aspect ratio. Set mywidth to the desired with in pixels.
import PIL
from PIL import Image
mywidth = 300
img = Image.open('someimage.jpg')
wpercent = (mywidth/float(img.size[0]))
hsize = int((float(img.size[1])*float(wpercent)))
@kroger
kroger / gist:3856835
Created October 9, 2012 05:41
Example of Sphinx conf.py
# -*- coding: utf-8 -*-
import sys, os
sys.path.insert(0, os.path.abspath('extensions'))
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.todo',
'sphinx.ext.coverage', 'sphinx.ext.pngmath', 'sphinx.ext.ifconfig',
'epub2', 'mobi', 'autoimage', 'code_example']