Skip to content

Instantly share code, notes, and snippets.

@khardix
khardix / download.py
Created October 6, 2017 11:26
Python AsyncIO/aiohttp downloader with progressbars
#!/usr/bin/env python3.6
import asyncio
from contextlib import closing
import aiohttp
import tqdm
async def download(session, url, progress_queue):
@khardix
khardix / http_lang.pm
Created April 7, 2018 18:19
nginx perl module for processing Accept-Language HTTP header
package http_lang;
use nginx;
sub quality {
my $lang = shift;
if ($lang =~ /;q=(\d\.\d+)$/) {
return $1;
}
@khardix
khardix / mako.service
Created March 18, 2019 08:51
Mako dbus activation unit file draft
[Unit]
Description=Mako notification daemon
Documentation=man:mako(1) man:makoctl(1)
PartOf=graphical-session.target
[Service]
Type=dbus
BusName=org.freedesktop.Notifications
ExecStart=/usr/bin/mako