Skip to content

Instantly share code, notes, and snippets.

View Janiczek's full-sized avatar

Martin Janiczek Janiczek

View GitHub Profile
@Janiczek
Janiczek / SList.elm
Created February 11, 2025 23:10
For some reason ltail is O(n) while rtail is O(1)
module SList exposing
( SList, empty, fromList, toList
, lcons, rcons
, lhead, rhead
, ltail, rtail
, reverse
)
type SList a

Times in milliseconds

day parse part1 part2
1 2.96 1.56 7.05
2 1.83 0.1940 1.42
3 2.97 0.014 0.005
4 4.46 65.15 3.91
5 1.59 0.374 0.622
6 5.6 0.920 371.96
@Janiczek
Janiczek / adventofcode.com.css
Last active December 4, 2024 09:26
Advent of Code - Gruvbox user CSS
* {
font-family: "JetBrains Mono" !important;
font-size: 14px;
font-weight: 500;
}
code::before {
top: -1px;
bottom: -1px;
left: -4px;
@Janiczek
Janiczek / 00_README.md
Last active November 18, 2024 13:58
Arturia Minilab 3 Sysex codes

Arturia Minilab 3 SysEx messages

I was mainly interested in finding out how to change pad colours.

There was this Github repo detailing some SysEx messages for Minilab 2, but that didn't work for Minilab 3.

In the end I downloaded the DAW integration scripts from the Resources page and decompiled the Bitwig Java classes (you need to unzip the .bwextension file). That gave me the coveted secret SysEx commands :)

Initialization

@Janiczek
Janiczek / RAList.elm
Created February 28, 2024 22:33
Random access lists in Elm (WIP)
module RAList exposing (RAList, cons, empty, fromList, head, isEmpty, lookup, tail, update)
{-| Okasaki, Random Access Lists
<https://dl.acm.org/doi/pdf/10.1145/224164.224187>
O(1) list operations (cons, head, tail)
O(log\_2 n) array operations (lookup, update)
-}
@Janiczek
Janiczek / crc32.hvm
Created February 28, 2024 18:27
CRC32 in HVM
/*
CRC32 in HVM
A port of https://github.com/openbsd/src/blob/d4c9bc7e07bcf455e26a4d261eb43cf80a9b7fe1/bin/md5/crc.c
*/
testString = "foo bar baz" // --> CRC: 2461288740
main = (CRC.run testString)
# Fast macOS key repeat
https://apple.stackexchange.com/questions/10467/how-to-increase-keyboard-key-repeat-rate-on-os-x
defaults write -g InitialKeyRepeat -int 10 # normal minimum is 15 (225 ms)
defaults write -g KeyRepeat -int 1 # normal minimum is 2 (30 ms)
@Janiczek
Janiczek / .vimrc
Created January 20, 2024 17:53
Elm errors in the editor
" ALE
let g:ale_linters = {
\ 'elm': ['make'],
\ }
Plug 'dense-analysis/ale'
Plug 'blueyed/vim-qf_resize'
let g:ale_linters_explicit = 1
let g:ale_open_list = 1
@Janiczek
Janiczek / Main.elm
Created December 3, 2023 07:21
Synchronous string normalization in Elm
module Main exposing (main)
import Html exposing (Html)
import Json.Decode
import Json.Encode
main : Html msg
main =
Html.ul []
@Janiczek
Janiczek / Common.elm
Last active September 15, 2023 21:37
Elm implementations of shortest distance between two 3D line segments
module Common exposing
( Point
, Segment
, add
, addK
, distance
, dot
, magnitude
, mid
, scale