Problem:
- Click on some place that has a website.
- Middle-click on the apparent link to open it in a new tab - nothing happens.
Solution:
| #!/usr/bin/env python | |
| """ | |
| example use: | |
| ./avahi-notify.py - notify for all interfaces | |
| ./avahi-notify.py eth0 - notify only for eth0 interface | |
| """ | |
| import io | |
| import subprocess | |
| import sys |
| def merge(original: dict, update: dict): | |
| return { | |
| k: (merge(original[k], v) if M and isinstance(v, dict) and k in original else v) | |
| for d, M in ((original, False), (update, True)) | |
| for k, v in d.items() | |
| } | |
| if __name__ == "__main__": | |
| base = {"foo": 1, "bar": {"abc": 123, "def": 456}, "baz": 2} |
| #!/usr/bin/env python3 | |
| """ | |
| A service to toggle play/pause of a Chromecast via Play multimedia key. | |
| Requires running as root because of the "keyboard" module. | |
| requirements: pychromecast keyboard | |
| """ | |
| chromecast_name = "Salon" |
| #!/bin/sh | |
| set -x | |
| set -e | |
| pkg="$1" | |
| repo="$2" | |
| function __BUILD__() { | |
| local pkg="$1" | |
| local arch="$2" |
| #if 0 | |
| set -e; | |
| cflags="-O2 -Wall -Wextra -pedantic -std=c99" | |
| [ "$0" -nt "$0-regular.bin" ] && | |
| gcc $cflags -lpthread "$0" -o "$0-regular.bin" | |
| [ "$0" -nt "$0-static.bin" ] && { | |
| mkdir -p musl-inc |
| #!/bin/sh | |
| cmd=$1 | |
| shift | |
| # FIXME: it would be good for every argument to be wrapped in quotes | |
| echo run $@ | gdb "$cmd" -x strace.gdb &> gdb-strace-log |
| #if 0 | |
| set -e; [ "$0" -nt "$0.bin" ] && | |
| gcc -Wall -Wextra -pedantic -std=c99 "$0" -o "$0.bin" | |
| exec "$0.bin" "$@" | |
| #endif | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #define LEN(x) (sizeof(x)/sizeof((x)[0])) |
| #define _XOPEN_SOURCE | |
| #include <assert.h> | |
| #include <stdbool.h> | |
| #include <stddef.h> | |
| #include <stdint.h> | |
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <string.h> | |
| #include <unistd.h> |
| #!/bin/bash | |
| set -e | |
| VERSION="siteprep-1" | |
| EXT=".html" | |
| HEAD='<!DOCTYPE html> | |
| <meta charset=utf-8> | |
| <meta name=viewport content="width=device-width,initial-scale=1"> | |
| <style> |