Skip to content

Instantly share code, notes, and snippets.

@5p4k
5p4k / clique_partitions.py
Created June 21, 2020 14:33
Partition the edges of K_n into blocks of k vertex-disjoint m-cliques.
#!/usr/bin/python3.8
# Copyright 2020 Pietro Saccardi
# Licensed under CC BY-NC 4.0, https://creativecommons.org/licenses/by-nc/4.0/
from itertools import combinations
from copy import deepcopy
from typing import List, Set, Optional, Iterable, Union
def build_complete_graph(vertex_count: int) -> List[Set[int]]:
@5p4k
5p4k / psl_test.log
Created May 8, 2020 21:47
Results of running `make test` on mittelab.dev PR to PSL
cd linter; \
./pslint_selftest.sh; \
./pslint.py ../public_suffix_list.dat;
-n test_NFKC:
OK
-n test_allowedchars:
OK
-n test_dots:
OK
-n test_duplicate:
@5p4k
5p4k / rpi-netstatus.service
Created March 25, 2020 15:54
Blink Raspberry Pi LEDs depending on network status
[Unit]
Description=Network status as LED
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=always
RestartSec=1
User=pi
ExecStart=/usr/local/bin/rpi-netstatus.sh
@5p4k
5p4k / gpg_rotation.txt
Created March 24, 2020 20:37
GPG key rotation
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
I am rotating my GPG key.
My old key has fingerprint:
100C EE86 3348 EA30 3D1F E65E C495 D128 2B09 13C0
My new key has fingerprint:
@5p4k
5p4k / srgb_gamma.py
Last active October 3, 2017 20:18
Gamma transfer and correction functions for sRGB.
#
# Copyright (C) 2017 Pietro Saccardi <lizardm4@gmail.com>
#
# This work is free. You can redistribute it and/or modify it under the
# terms of the Do What The Fuck You Want To Public License, Version 2,
# as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.
#
# ----
#
# Blend your RGB colors correctly! Convert them to a linear space first.
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{bonntitle}[2015/10/27]
\newcommand*{\university}[1]{\def\@university{#1}}
\newcommand*{\institute}[1]{\def\@institute{#1}}
\newcommand*{\birthday}[1]{\def\@birthday{#1}}
\newcommand*{\birthplace}[1]{\def\@birthplace{#1}}
\newcommand*{\worktype}[1]{\def\@worktype{#1}}
\newcommand*{\advisor}[1]{\def\@advisor{#1}}
\newcommand*{\theadvisor}{Advisor:~\@advisor}
@5p4k
5p4k / beamer.tex
Created October 24, 2015 10:06
Basic beamer template
\documentclass{beamer}
\usepackage[utf8]{inputenc}
% Just for sampling
\usepackage{lipsum}
% Font warning suppression
\usepackage{ulem}
\usepackage{lmodern}
@5p4k
5p4k / keybase.md
Last active December 5, 2023 20:51

Keybase proof

I hereby claim:

  • I am 5p4k on github.
  • I am 5p4k (https://keybase.io/5p4k) on keybase.
  • I have a public key ASBH0WJUto5gyN7inQoUE_QKwsUsn7uHJTUdzB0jxwBR8Ao

To claim this, I am signing this object: