-
Install Raspberry Pi Imager
$ sudo snap install rpi-imager
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
// Execute me in Console on the repository page | |
Array.prototype.map.call(document.querySelectorAll('a[class=anchor]'), el => { | |
var href = el.href, | |
title = el.parentElement.textContent.replace(/^\s+|\s+$/g, ''), | |
level = parseInt(el.parentElement.tagName.substr(1)), | |
indent = (new Array(level)).join(' '); | |
return indent + '* <a href="'+href.replace(/^user-content-/, '')+'">'+title+'</a>'; | |
}).join("\n "); | |
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 time | |
import asyncio | |
import functools | |
def runs_in_threadpool(function): | |
""" Decorate a sync function to become an async one run in a threadpool """ | |
@functools.wraps(function) | |
async def wrapper(*args, **kwargs): | |
loop = asyncio.get_event_loop() |
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 sys | |
import socket | |
class SocketLock: | |
""" A global named lock. Better than pidfiles. | |
This uses a bind() on AF_UNIX sockets as a means to acquire a lock that is non-blocking. | |
Socket files are not created in the real filesystem, but in an "abstract namespace": | |
a Linux-only feature of hidden socket files. |
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
# https://docs.python.org/3/library/typing.html#typing.Generator | |
# 💥💥💥 Simple generator: yield values one by one | |
# This function pauses to return a value to the outer scope, then proceeds | |
DICTIONARY = { | |
'a': 'apple', | |
'b': 'banana', | |
'c': 'cat', |
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
# Source: common sense | |
PERSON_TYPES = { | |
'Natural': 'Физическое лицо', | |
'Legal': 'Юридическое лицо', | |
} | |
# Source: https://documenter.getpostman.com/view/3912450/TWDdkZcK | |
OPERATION_TYPES = { |
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
ШКОЛЬНЫЙ ЦИТАТНИК | |
(из личной коллекции) | |
Вартанян Марк, 17 сентября 2002 год | |
Математика. | |
Ирина Александровна: | |
- Это материал какого класса? Шестого! Вы поняли меня? | |
- Маша [Лысанчук], эти кнопки похожи на точки. Возьми, и прикнопь их в уравнение. | |
- Что вы делаете карандашом?! Ручки на место положите! |
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
Доклад Святейшего Патриарха Кирилла, 22 декабря 2021 | |
https://www.youtube.com/watch?v=IVrzLXCKkLE | |
00:36 Профилактические меры могут быть неприятны, как например, длительное ношение масок. Призыва всех потерпеть — в первую очередь, ради сохранения возможности участия в божественной евхаристии | |
02:55 Благодарность тому духовеству, которое самоотверженно трудится в красной зоне, не опасаясь ни инфекции, ни последствий. | |
03:50 Кто-то считает вакцинацию нужной, кто-то неприемлемой |
Чтобы получить доступ, нужно войти под своей учетной записью на my.starline.ru и перейти на страницу https://my.starline.ru/developer. После заполнения формы, заявку на предоставление доступа к API для аккаунта рассмотрят сотрудники StarLine.
Получение кода приложения для дальнейшего получения токена. Срок годности кода приложения – 1 час.
$ http GET https://id.starline.ru/apiV3/application/getCode appId==123456 secret==(echo -n "<secret>" | md5sum | cut -d' ' -f1)
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
#!/bin/bash | |
# .git/hooks/pre-commit | |
# Find "//nocommit" lines in the diff, do not allow them | |
# This line will output all "nocommit" lines, if any: you'll see this as git error. | |
git diff --no-ext-diff --cached | grep -iE '//\s*nocommit' | |
# If the retcode=0, then "nocommit" lines were found. Fail on them. | |
if [[ $? -eq 0 ]]; then |