"Магии нет)"
— Роман Горбиль
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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), | |
] |