| import {Layout, LayoutProps} from "@motion-canvas/2d/lib/components" | |
| import {Rect, Vector2} from "@motion-canvas/core/lib/types"; | |
| import {property} from "@motion-canvas/2d/lib/decorators" | |
| import {all, sequence} from "@motion-canvas/core/lib/flow"; | |
| import {Signal, SignalValue} from "@motion-canvas/core/lib/utils"; | |
| import {drawRect} from "@motion-canvas/2d/lib/utils"; | |
| import {easeOutCubic, linear} from "@motion-canvas/core/lib/tweening"; | |
| import {decorate, threadable} from "@motion-canvas/core/lib/decorators" | |
| // a very minimal instruction set. | |
| // it has just enough operations to implement a recursive | |
| // fibonacci function - what a coincidence :D | |
| // NOTE: in my VM, i don't use an `enum`. | |
| // this is just for simplicity. | |
| #[derive(Clone, Copy, Debug)] | |
| enum Instruction { | |
| LoadInt { dst: u8, value: i16 }, | |
| Copy { dst: u8, src: u8 }, | |
| Add { dst: u8, src1: u8, src2: u8 }, |
Zig aims to be a simple language. It is not easy to define what simple exactly means, but zig is also a low-level programming language that aims for c-compatibility. To reach this goal, it needs good semantics in its type system so that developers have a complete toolbox to manipulate data.
So types in zig are composable, but this can become rapidly overwhelming. See those examples. Are you able to understand them at a glance, as soon as you read them?
*const ?u8
?*const u8
*const [2]u8
This note details the changes made to the Zen and ZMK codebase to improve the experience of e-ink displays.
Important
As of 2025-12, I no longer maintain the Zen branches under https://github.com/caksoylar/zmk. Please switch to the zen-display-patches branch maintained by @SethMilliken as noted below.
You can test out below changes using your Zen config repo by modifying your config/west.yml file, following ZMK instructions:
| let rec eval = function | |
| | `Appl (m, n) -> ( | |
| let n' = eval n in | |
| match eval m with `Lam f -> eval (f n') | m' -> `Appl (m', n')) | |
| | (`Lam _ | `Var _) as t -> t | |
| let sprintf = Printf.sprintf | |
| (* Print a given term using De Bruijn levels. *) | |
| let rec pp lvl = function |
| trait Interp { | |
| type Repr<T>; | |
| fn lit(i: i32) -> Self::Repr<i32>; | |
| fn add(a: Self::Repr<i32>, b: Self::Repr<i32>) -> Self::Repr<i32>; | |
| } | |
| struct Eval; | |
| impl Interp for Eval { |
| ### colored and fuzzy go doc | |
| if which bat > /dev/null; then | |
| function _godoc() { | |
| if echo $1|grep -q -E "([a-zA-Z0-9/.-_]+)/.*\..*"; then | |
| go doc ${@} | bat -p -l go | |
| else | |
| go doc ${@} | bat -p -l md | |
| fi | |
| } | |
| else |
| ### colored and fuzzy go doc | |
| if which bat > /dev/null; then | |
| function _godoc() { | |
| if echo $1|grep -q -E "^([a-zA-Z0-9/]+)$"; then | |
| go doc ${@} | bat -p -l md | |
| elif echo $1|grep -q -E "^[a-zA-Z0-9/]+\.[a-zA-Z0-9.]+$"; then | |
| go doc ${@} | bat -p -l go | |
| elif echo $1|grep -q -E "^([a-zA-Z0-9/._-]+)/.*\.[a-zA-Z0-9.]+$"; then | |
| go doc ${@} | bat -p -l go | |
| else |
| object main extends App { | |
| object <<<<<<< { | |
| def HEAD(s: String) = this | |
| } | |
| implicit class StringOps(s: String) { | |
| def =======(i: Int) = s | |
| def >>>>>>>(i: Int) = i | |
| } |