Skip to content

Instantly share code, notes, and snippets.

View AlexanderWingard's full-sized avatar

Alexander Wingård AlexanderWingard

View GitHub Profile
(defcfg
;; ** For Linux **
input (device-file "/dev/input/by-path/platform-i8042-serio-0-event-kbd")
;; input (device-file "/dev/input/by-id/usb-Matias_Ergo_Pro_Keyboard-event-kbd")
output (uinput-sink "KMonad output")
;; ** For Windows **
;; input (low-level-hook)
;; output (send-event-sink)
@AlexanderWingard
AlexanderWingard / git-char-log.sh
Last active October 8, 2020 12:31
Character count csv of folder in git
#!/bin/bash
for commit in $(git rev-list --reverse --topo-order HEAD -- .)
do
sum=0
for file in $(git ls-tree -r --name-only $commit)
do
if [[ $(git show $commit:./$file | file -ib -) =~ "text/" ]]
then
count=$(git show $commit:./$file | tr -d '[:space:]' | wc -c)
@AlexanderWingard
AlexanderWingard / __main__.py
Created May 1, 2019 21:05
Trying to package hy with zipapp
import hy
import hyz
hyz.main()
@AlexanderWingard
AlexanderWingard / calico.yaml
Last active December 5, 2017 21:44
Kube it!
# Calico Version v2.6.3
# https://docs.projectcalico.org/v2.6/releases#v2.6.3
# This manifest includes the following component versions:
# calico/node:v2.6.3
# calico/cni:v1.11.1
# calico/kube-controllers:v1.0.1
# This ConfigMap is used to configure a self-hosted Calico installation.
kind: ConfigMap
apiVersion: v1
@AlexanderWingard
AlexanderWingard / .gitignore
Created June 28, 2017 12:48
envsubst example
out/*
@AlexanderWingard
AlexanderWingard / index.html
Created June 20, 2017 13:42
Smooth timebar
<!doctype HTML>
<html>
<head>
<script src="https://d3js.org/d3.v4.min.js"></script>
<style>
svg {
width: 100%;
height: 200px;
}
rect {
import logging
import subprocess
import sys
import select
import shlex
from fcntl import fcntl, F_GETFL, F_SETFL
from os import O_NONBLOCK
from cStringIO import StringIO
logging.basicConfig(format="%(asctime)s %(out)3s %(prog)8s %(message)s", level=logging.DEBUG)
import logging
import subprocess
import shlex
from subprocess import Popen, PIPE
from threading import Thread
from Queue import Queue, Empty
logging.basicConfig(format="%(asctime)s %(out)3s %(prog)8s | %(message)s", level=logging.DEBUG)
@AlexanderWingard
AlexanderWingard / index.html
Last active August 29, 2015 14:18
D3 Nest Columns
<!DOCTYPE html>
<meta charset="utf-8">
<body>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script>
var data = [{col: "A", val: "one"},
{col: "B", val: "two"},
{col: "B", val: "three"},
{col: "B", val: "four"},
@AlexanderWingard
AlexanderWingard / gist:5814843
Last active December 18, 2015 16:58
org-goto-subtree
(require 'org-element)
(defun goto-notes ()
(interactive)
(find-file "/home/lex/org/test.org")
(org-goto-subtree '("a" "b" "q" "h"))
(org-show-context)
(org-show-entry)
(show-children))
(defun org-goto-subtree (path)