Skip to content

Instantly share code, notes, and snippets.

View deniskrumko's full-sized avatar
🙈
no bugs

Denis Krumko deniskrumko

🙈
no bugs
View GitHub Profile
@deniskrumko
deniskrumko / resident_days.py
Created October 21, 2022 10:14
Calculate if you are resident or not
from datetime import datetime, timedelta
from functools import lru_cache
CALC_START = '01.01.2021'
CALC_END = '01.01.2024'
TRIPS = [
('08.03.2022', '03.04.2022'),
('01.10.2022', '15.10.2022'),
('15.10.2022', None),
]
@deniskrumko
deniskrumko / script.js
Created April 12, 2022 12:05
Bitbucket Review Tampermonkey
// ==UserScript==
// @name Bitbucket Review
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Highlight and fold replies
// @author You
// @match https://stash.dev.itc.homecredit.ru/*/pull-requests/*
// @require http://code.jquery.com/jquery-3.4.1.min.js
// @run-at document-body
// @grant none
%7|1649256093.940|MEMBERID|rdkafka#consumer-1| [thrd:app]: Group "group_id_AAA": updating member id "(not-set)" -> ""
%7|1649256093.940|INIT|rdkafka#consumer-1| [thrd:app]: librdkafka v1.8.2 (0x10802ff) rdkafka#consumer-1 initialized (builtin.features gzip,snappy,ssl,sasl,regex,lz4,sasl_gssapi,sasl_plain,sasl_scram,plugins,zstd,sasl_oauthbearer, CC CXX PKGCONFIG OSXLD LIBDL PLUGINS ZLIB SSL SASL_CYRUS ZSTD HDRHISTOGRAM LZ4_EXT SYSLOG SNAPPY SOCKEM SASL_SCRAM SASL_OAUTHBEARER CRC32C_HW, debug 0x500)
%7|1649256093.940|CGRPSTATE|rdkafka#consumer-1| [thrd:main]: Group "group_id_AAA" changed state init -> query-coord (join-state init)
%7|1649256093.940|CGRPQUERY|rdkafka#consumer-1| [thrd:main]: Group "group_id_AAA": no broker available for coordinator query: intervaled in state query-coord
%7|1649256093.940|CGRPOP|rdkafka#consumer-1| [thrd:main]: Group "group_id_AAA" received op SUBSCRIBE in state query-coord (join-state init)
%7|1649256093.940|SUBSCRIBE|rdkafka#consumer-1| [thrd:main]: Group "group_id_AAA": subsc
@deniskrumko
deniskrumko / Presets.md
Last active October 30, 2021 09:29
Yamaha THR10II пресеты

Подборка стандартных пресетов для Yamaha THR10II

Список нашел в интернете, перевел на русский, добавил ссылки на YouTube. Пользуйтесь!

  • ХБ - хамбакер
  • СГ - сингл
Пресет Описание
1. EarlyVH Ранний Van Halen. С первого альбома до 1984.
@deniskrumko
deniskrumko / stylus.css
Created October 25, 2021 10:02
Stylus dark theme
/* DARK THEME */
html {
filter: invert(100%) hue-rotate(180deg) brightness(105%) contrast(85%);
-webkit-filter: invert(100%) hue-rotate(180deg) brightness(105%) contrast(85%);
}
img,
video,
gl-emoji,
@deniskrumko
deniskrumko / python.md
Created April 4, 2019 10:20
Python things

Python - динамический интерпретируемый язык


Можно присвоить значение одной функции - другой функции

foo.__code__ = bar.__code__
@deniskrumko
deniskrumko / run_isort.py
Created February 25, 2019 08:35
Run isort only for modified files
import subprocess
result = subprocess.check_output(['git', 'status', '-s'])
result = result.decode('utf-8')
files = []
for line in result.split('\n'):
line = line.strip()
if line.startswith('M') or line.startswith('??') or line.startswith('A'):
path = line.split()[1]
@deniskrumko
deniskrumko / example.py
Created April 9, 2018 13:58
Save image from URL to ImageField
from django.core.files.base import ContentFile
from urllib.parse import urlparse
from urllib.request import urlopen
# Example URL
image_url = 'images.com/image.png'
# `obj` has `image` field
sample_obj = SampleObject.objects.first()
@deniskrumko
deniskrumko / collapse_inlines.js
Created March 29, 2018 11:40
Django Suit collapsed (folded) inlines
// Attach this script to your "ModelAdmin" class by "Media"
jQuery(function($) {
$(function () {
Suit.after_inline.register('my_unique_func_name', function(inline_prefix, row){
var $group = $(row).parent();
if ($group.hasClass('collapsed')) {
$group.removeClass('collapsed');
$group.find('.inline-related:not(.empty-form)').each(function (index, element) {
$(element).show();
@deniskrumko
deniskrumko / quotes.md
Last active October 30, 2021 09:34
Quotes of programmers

Цитаты великих программистов

"Магии нет)"

Роман Горбиль