Skip to content

Instantly share code, notes, and snippets.

View thenonameguy's full-sized avatar
🛠️
Preparing Schemamap.io go-live 🎉

Krisztián Szabó thenonameguy

🛠️
Preparing Schemamap.io go-live 🎉
View GitHub Profile
@thenonameguy
thenonameguy / default.nix
Created December 30, 2020 13:42
NixOS zprint clojure local default.nix
{ stdenv, zlib, lib, qt5, saneBackends, makeWrapper, fetchurl }:
stdenv.mkDerivation rec {
name = "zprint-bin-${version}";
version = "1.0.2";
src = ./.;
dontConfigure = true;
dontBuild = true;
@thenonameguy
thenonameguy / distinct-by.clj
Created March 10, 2021 15:24
distinct-by clojure transducer
(defn distinct-by
"Returns a stateful transducer that removes elements by calling f on each step as a uniqueness key.
Returns a lazy sequence when provided with a collection."
([f]
(fn [rf]
(let [seen (volatile! #{})]
(fn
([] (rf))
([result] (rf result))
([result input]
@thenonameguy
thenonameguy / headphone.py
Last active July 6, 2021 10:53 — forked from Monsterovich/headphone.py
NixOS Pipewire headphone jack fix
#!/usr/bin/env python
import os
import sys
from subprocess import Popen, PIPE, STDOUT
import time
HEADPHONE_EVENT = "jack/headphone"
p = Popen(["/run/current-system/sw/sbin/acpi_listen"],
stdout=PIPE, stderr=STDOUT, bufsize=1)