Skip to content

Instantly share code, notes, and snippets.

View ordnungswidrig's full-sized avatar

Philipp Meier ordnungswidrig

View GitHub Profile
@ordnungswidrig
ordnungswidrig / babash.bb
Last active November 16, 2023 01:52
A very basic shell implemented in babashka
#!/usr/bin/env rlwrap bb -i
;; needs babashka beta
(defn ^sun.misc.Signal ->signal
"Convert a keyword to an appropriate Signal instance."
[signal]
(sun.misc.Signal. (-> signal name .toUpperCase)))
(defn ^Long signal->number
@ordnungswidrig
ordnungswidrig / day-01.sh
Last active December 4, 2021 17:21
AoC-2021 - pointfree - threading
# part one
pbpaste | bb -I -e '(->> (-> *input* (#(vector % %)) (update 1 rest)) (apply map <) (filter true?) count)'
# part two
pbpaste | bb -I -e ' (->> *input* (iterate rest) (take 3) (apply map +) (#(vector % %)) (#(update % 1 rest)) (apply map <) (filter true?) count)'
@ordnungswidrig
ordnungswidrig / microweb.cljs
Created December 10, 2019 11:12
Webserver in clojurescript on espruino
(set! *warn-on-infer* true)
(def ^js wifi (js/require "Wifi"))
(def ^js http (js/require "http"))
(def n (atom 0))
(defn build-response []
(str
"<html>"
@ordnungswidrig
ordnungswidrig / compile-upload.sh
Created November 26, 2019 02:23
clojurescript on esp32
clj -m cljs.main -O advanced -co '{:infer-externs true}' --output-to main.js
echo "Upload with"
echo "espruino main.js"
echo "Or use the Espruino web IDE"
{-# LANGUAGE DuplicateRecordFields #-}
-- how to resolve the duplication in CreateUser, BasicUser and UpdateUser
-- without changing everything to `Maybe String`?
data Address = Address { street :: String
, zip :: String
, city :: String
, state :: String
} deriving (Show)
@ordnungswidrig
ordnungswidrig / pres.el
Created December 4, 2018 19:46
presentation helper for live demo in emacs
(defun c6e/pres-forward ()
(interactive)
(let ((saved (point)))
(forward-line)
(let ((beg (point)))
(search-forward-regexp "^;;; " nil t)
(if (= beg (point))
(goto-char saved)
(progn
(recenter 0)
@ordnungswidrig
ordnungswidrig / gherkinqqwertzde7.json
Created June 27, 2017 13:13
Gherkin german QWERTZ layout
{"version":1,"keyboard":{"keys":[{"id":0,"legend":"Q","state":{"x":0,"y":0,"r":0,"rx":0,"ry":0,"w":1,"h":1,"x2":0,"y2":0,"w2":0,"h2":0},"row":0,"col":0,"keycodes":[{"id":"LT()","fields":[1,{"id":"KC_Q","fields":[]}]},{"id":"KC_F1","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_NO","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]}]},{"id":1,"legend":"W","state":{"x":1,"y":0,"r":0,"rx":0,"ry":0,"w":1,"h":1,"x2":0,"y2":0,"w2":0,"h2":0},"row":0,"col":1,"keycodes":[{"id":"LT()","fields":[3,{"id":"KC_W","fields":[]}]},{"id":"KC_F2","fields":[]},{"id":"KC_MSTP","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","fields":[]},{"id":"KC_TRNS","f
#include "bootloader.h"
#include "keymap_common.h"
const uint8_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
KEYMAP( // Layer 0
ESC, 1, 2, 3, 4, 5, EQL, // 7
TAB, Q, W, E, R, T, FN1, // 7
LCTRL, A, S, D, F, G, // 6
LSFT, Z, X, C, V, B, FN2, // 7
FN3, NONUS_BSLASH, LCTRL, LALT, LGUI, // 5 L3
@ordnungswidrig
ordnungswidrig / color-overlay-calc-klipse.cljs
Created February 2, 2017 09:19
Mutliple color overlay functions rendered with reagent in kilpse
;; color definitions in css rgba format
(def base-color [60 151 35 1])
(def overlays [[255 255 255 .23]
[255 255 255 .61]
[255 255 255 1]])
(require '[clojure.string :as s]
'[reagent.core :as reagent])

Apex architecture on documents, forms and modality

Motivation

During the execution of workflows at certain points information must be presented to the user and information must be gathered from the user. The actualy input method depends on the device that is used by a user, ranging from a web application to filling out a paper form.

The attributes of different devices are collected in “modalities” which describes a group of devices sharing common properties.

The data that shall be collected varies in shape and size, ranging from a single decision (“checkbox”) over what is a