Skip to content

Instantly share code, notes, and snippets.

Avatar

Julian Andres Klode julian-klode

View GitHub Profile
View a.hs
import Control.Monad
main = do topic <- getLine
payload <- getLine
let msg = Message (Topic topic) payload
mapM_ (runAction topic payload) rules
where
runAction topic payload (Action (Topic t) cb)
= when (t == topic) $ cb payload
View in-container
#!/bin/sh
. /etc/os-release
case "$DISTRO" in
*:*)
ID=$(echo $DISTRO | cut -f1 -d:)
VERSION_CODENAME=$(echo $DISTRO | cut -f2 -d:)
;;
View 99chrome-vaapi
Dpkg::Post-Invoke:: "grep -q Vaapi /opt/google/chrome/google-chrome || sed -i 's#^exec.*HERE.*/chrome.*#\0 --enable-features=VaapiVideoDecoder#' /opt/google/chrome/google-chrome";
View plot-hr.py
#!/usr/bin/python3
#
# Copyright (C) 2020-2021 Julian Andres Klode <jak@jak-linux.org>
#
# This Source Code Form is subject to the terms of the Mozilla
# Public License, v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at
# https://mozilla.org/MPL/2.0/.
#
"""HR plotting script.
View plot-hr.py
#!/usr/bin/python3
#
# Copyright (C) 2020-2021 Julian Andres Klode <jak@jak-linux.org>
#
# This Source Code Form is subject to the terms of the Mozilla
# Public License, v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at
# https://mozilla.org/MPL/2.0/.
#
"""HR plotting script.
View plot-hr.py
#!/usr/bin/python3
#
# Copyright (C) 2020-2021 Julian Andres Klode <jak@jak-linux.org>
#
# This Source Code Form is subject to the terms of the Mozilla
# Public License, v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at
# https://mozilla.org/MPL/2.0/.
#
"""HR plotting script.
View plot-hr
#!/usr/bin/python3
#
# Copyright (C) 2020-2021 Julian Andres Klode <jak@jak-linux.org>
#
# This Source Code Form is subject to the terms of the Mozilla
# Public License, v. 2.0. If a copy of the MPL was not distributed
# with this file, You can obtain one at
# https://mozilla.org/MPL/2.0/.
#
"""HR plotting script.
@julian-klode
julian-klode / liberal-pinning.md
Last active Mar 19, 2021
APT solver questions
View liberal-pinning.md

Given packages a and b with versions 1,2,3 (higher is more preferred), and a dependency A|B giving preference to A, how would you expect a dependency a|b to expand?

  1. A over B within each preference level:
    a (= 3) | b (= 3) | a (= 2) | b (= 2) | a (= 1) | b (= 1)
    
  2. any A over any B:
    a (= 3) | a (= 2) | a (= 1) | b (= 3) | b (= 2) | b (= 1)
    
View InRelease
Origin: Ubuntu
Label: Ubuntu
Suite: hirsute
Version: 21.04
Codename: hirsute
Date: Thu, 04 Feb 2021 9:47:45 UTC
Architectures: amd64 arm64 armhf i386 ppc64el riscv64 s390x
Components: main restricted universe multiverse
Description: Ubuntu Hirsute 21.04
MD5Sum:
View hledger-bug-value.journal
; $ hledger -f f bal -p 2020 --value=end assets -Y
; Period-end value changes in 2020:
;
; || 2020
; ====================++=========
; assets:investments || -13.59€
; --------------------++---------
; || -13.59€
; $ hledger -f f bal -p 2020 --value=end assets
; -9.79€ assets:investments