Skip to content

Instantly share code, notes, and snippets.

@hg
hg / darker.md
Last active May 3, 2026 09:51
HIgh contrast theme for JetBrains IDEs with softer scrollbars that do not burn your eyes

The official high contrast theme uses almost white scrollbars that draw too much attention and feel like looking at the sun.

Tested in:

  • Rider
  • IDEA

Should work everywhere since all their IDEs are repackaged IDEA with a bunch of plugins.

How to use:

@hg
hg / nginx.conf
Created May 3, 2026 09:41
nginx spoonfeding garbage to badly behaved bots
if ($http_user_agent ~* "foo.ai") {
limit_rate 1k;
default_type application/octet-stream;
proxy_buffering off;
alias /dev/urandom;
return 200;
}
@hg
hg / mrakopedia.recipe
Created May 3, 2026 08:55
mrakopedia.net Calibre recipe
#!/usr/bin/env python3
# vim: ft=python sw=4 sts=4 et si
__license__ = "GPL v3"
__author__ = "hg"
from calibre.web.feeds.recipes import BasicNewsRecipe
base_url = "https://mrakopedia.net"
logo_url = base_url + "/logos/default.gif"
@hg
hg / postgresql-snake-case.md
Last active May 1, 2026 18:36
PostgreSQL / EF Core snake case naming

EFCore.NamingConventions is easier to use, but it does not rename "system" tables ("AspNetUsers" and the like).

protected override void OnModelCreating(ModelBuilder builder) {
  base.OnModelCreating(builder);

  // keep last or newly created objects won't be renamed
@hg
hg / aspnet.md
Last active March 28, 2026 13:20
ASP.NET/Serilog config for the lnav log viewer
@hg
hg / lato.css
Created November 29, 2025 18:05
lato.css
@font-face {
font-family: "Lato";
src: url("Hairline.woff2") format("woff");
font-weight: 100;
font-style: normal;
font-display: swap;
}
@font-face {
font-family: "Lato";
src: url("HairlineItalic.woff2") format("woff");
@hg
hg / purelymail-alias.sh
Created July 19, 2024 13:28
quickly create / list / delete purelymail.com aliases
#!/bin/bash
set -euo pipefail
readonly token=purely-mail-token
readonly url=https://purelymail.com/api/v0
readonly domain=mail-domain.com
readonly target=name@$domain
request() {
@hg
hg / mullvad-lean.sh
Created May 13, 2024 18:24
lightweight ui to change active mullvad server
#!/usr/bin/bash
set -euo pipefail
for exe in sudo rofi wg curl jq; do
type "$exe" &>/dev/null || {
echo >&2 "please install $exe"
exit 1
}
done
@hg
hg / tld.md
Last active February 10, 2023 13:23
tld spam badness scores
static bool setup_default_deny(bool can_exec, scmp_filter_ctx ctx) {
ALLOW_CALL(rt_sigprocmask);
ALLOW_CALL(poll);
ALLOW_CALL(prctl);
ALLOW_CALL(_llseek);
ALLOW_CALL(accept);
ALLOW_CALL(arch_prctl);
ALLOW_CALL(bind);
ALLOW_CALL(brk);