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 / 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)
@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 / 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 / base.cljs
Created January 23, 2020 11:23
Combined pathom-viz UI
(ns com.wsscode.pathom.viz.standalone.base)
(defonce app (atom nil))
(defn reconciler []
(some-> app deref :reconciler))
(defn networks []
(some-> app deref :networking))
@thenonameguy
thenonameguy / config.edn
Created July 19, 2019 15:44
clj-kondo config example
{:linters
{:invalid-arity
{:skip-args [clojure.template/do-template]}}
:lint-as {com.wsscode.pathom.connect/defresolver clojure.core/defn
com.wsscode.pathom.connect/defmutation clojure.core/defn
ghostwheel.core/>defn clojure.core/defn
ghostwheel.core/>defn- clojure.core/defn
fulcro.client.primitives/defsc clojure.core/defn
mount.core/defstate clojure.core/def}}
(ns enchilada.simple-demo
(:require
[jayq.core :refer [show]]
[enchilada :refer [ctx canvas]]
[monet.canvas :refer [fill-style fill-rect]]))
(def dummy)
(show canvas)
(->
@thenonameguy
thenonameguy / pi_img.go
Created March 3, 2014 12:57
Golang pretty prime image generator, example output: http://imgur.com/w2BXltB
package main
import (
"flag"
"image"
"image/color"
"image/png"
"log"
"math"
"os"
@thenonameguy
thenonameguy / bartos.go
Created February 9, 2014 16:59
Bartos élete végéig köszöntő programocska
package main
import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"net/http"
"net/url"
"strconv"
@thenonameguy
thenonameguy / javitott.cs
Created December 8, 2012 19:23
Javított Tortosztalygrafikus
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace TortOsztalyosGrafikus
@thenonameguy
thenonameguy / matrix.py
Created December 8, 2012 14:14
NxN Matrix rotation
class SquareMatrix():
"""Square matrix implementation by thenonameguy"""
def __init__(self,size):
self.size = size
self.emptyMatrix()
def emptyMatrix(self):
self.matrix=[[0 for i in range(self.size)]for j in range(self.size)]
def makeIdentity(self):