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/sh -eu | |
po=$(printf %s *.??.po) | |
detail=false; if [ "x${1-}" = x-d ]; then detail=true; shift; fi | |
base=${1-/dev/null} | |
prev=; next=; diff= | |
trap 'rm -f "$prev" "$next" "$diff"' EXIT | |
prev=$(mktemp); next=$(mktemp); diff=$(mktemp) |
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/sh -eu | |
ENDPOINT="https://middleman.ferdinand-muetsch.de/api/messages" | |
if [ "$#" -ne 2 ]; then | |
echo "usage: $0 TOKEN ORIGIN" >&2 | |
exit 1 | |
fi | |
jq -ac --unbuffered --arg token "$1" --arg origin "$2" \ | |
'{"recipient_token": $token, "text": ., "origin": $origin}' | \ |
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
#!/usr/bin/env python3 | |
from collections import deque as Deque | |
from zipstream import ZipFile | |
class Buffer: | |
def __init__(self): | |
self.queue = Deque() | |
self.finished = False |
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/sh -eu | |
set -o pipefail | |
TRACE=${TRACE-}; export TRACE | |
tracef() { | |
fmt=$1; shift | |
if [ -t 2 ]; then printf '\033[0K%s'"$fmt"'\r' "$TRACE" "$@" >&2; fi | |
} | |
trap 'tracef ""' EXIT |
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
#!/usr/bin/env python3 | |
# NB Depends on dict preserving the insert order (CPython >= 3.6, PyPy all) | |
from csv import DictReader | |
from datetime import datetime as DateTime | |
from os import scandir | |
from simplejsonseq import dump | |
from sys import argv, stderr, stdout | |
import ietfcsv # ietf-tab CSV dialect |
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
<?xml version="1.0" encoding="utf-8"?> | |
<wsdl:definitions xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap12/" | |
xmlns:tns="http://www.drv.gov.ua/" | |
xmlns:s="http://www.w3.org/2001/XMLSchema" | |
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" | |
targetNamespace="http://www.drv.gov.ua/" | |
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"> | |
<wsdl:types> | |
<s:schema elementFormDefault="qualified" targetNamespace="http://www.drv.gov.ua/"> |
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/sh -eu | |
# NB: Contains literal tabs | |
caption() { | |
python -c ' | |
from os import getenv | |
from sys import argv | |
from telegram import Bot | |
from telegram.error import BadRequest, TimedOut |
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
45 | Город Москва | |
---|---|---|
45 301 | муниципальный округ Богородское | |
45 302 | муниципальный округ Вешняки | |
45 303 | муниципальный округ Восточное Измайлово | |
45 304 | муниципальный округ Восточный | |
45 304 000 106 | п Восточный | |
45 304 000 111 | п Акулово | |
45 305 | муниципальный округ Гольяново | |
45 306 | муниципальный округ Ивановское | |
45 307 | муниципальный округ Измайлово |
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
#!/usr/bin/env python3 | |
from gi import require_version | |
require_version('Gst', '1.0') | |
require_version('Gtk', '3.0') | |
from gi.repository import GObject, Gst, Gtk | |
from os.path import abspath | |
from sys import argv, stderr | |
from threading import Thread |
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 heapq import heappush, heappop | |
from math import inf | |
from trio import BrokenResourceError, ClosedResourceError, EndOfChannel, WouldBlock | |
from trio.abc import ReceiveChannel, SendChannel | |
from trio.lowlevel import ParkingLot, checkpoint, checkpoint_if_cancelled, cancel_shielded_checkpoint | |
from trio._channel import MemoryChannelStats | |
from trio._util import NoPublicConstructor | |
class MemoryChannelState: | |
__slots__ = ('data', 'max_buffer_size', 'number', 'open_send_channels', |