Skip to content

Instantly share code, notes, and snippets.

@uucidl
uucidl / 10x editor tips.org
Created August 7, 2023 07:29
Tips for using 10x

How to have diffent color scheme by project / repository / workspace

This makes it possible to work on multiple workspaces in parallel of the same project without confusing yourself as to which is which.

Each workspace can have its own 10x_settings file. Simply name it after the workspace name, adding the .10x_settings extension. In there you can customize the color scheme setting. And voila, you have a different color scheme for every workspace you load.

@uucidl
uucidl / APL style trees in C.md
Last active March 13, 2023 20:27
Representing trees not with noodly pointers, but as parallel arrays.
#define case(__x__) break; case __x__
#define fallthrough(__x__) case __x__
#define otherwise break; default
#include <assert.h>
#include <stdio.h>
int main(int argc, char **argv) {
switch(argc) {
case(0): printf("surprising\n");
@uucidl
uucidl / uu-re-link.el
Last active October 10, 2020 19:20
Let Emacs simulate Acme by creating clickable regexp links in the buffer.
@uucidl
uucidl / 01_materials.md
Last active August 5, 2020 09:10
Let's make a simple USB audio driver for xHCI hosts and Audio Class 1.0

If you develop drivers (Software) for USB peripherals then you may only need to read chapters, 4 - Architectural Overview 5 - USB Data Flow Model 9 - USB Device Frame Work, and 10 - USB Host Hardware and Software.

You probably also need to know xHCI. The host-side USB spec.

@uucidl
uucidl / real_mode_boot.c
Last active May 23, 2020 08:56
legacy bios bootsector
// -*- mode: c ; c-file-style: "k&r" -*-
// x86 boot sector.
//
// Once you execute this program you will get a series of disk images, which you can try in qemu:
// qemu -drive file=boot.img,format=raw
//
// and burn to a usb stick using something like rufus or dd
#include <assert.h>
#include <stdlib.h>
@uucidl
uucidl / wm.el
Created April 5, 2020 09:12 — forked from pervognsen/wm.el
Dynamic tiling window manager for Emacs (inspired by dwm/awesome/xmonad for Linux)
(require 'cl)
(defstruct wm-window buffer (point 0) (start 0) (hscroll 0) dedicated)
(defvar wm-windows)
(defvar wm-windows-alist)
(defvar wm-focus)
(defvar wm-workspace 0)
(defvar wm-workspaces nil)
(defvar wm-layout 0)
@uucidl
uucidl / compilation_times.md
Last active November 6, 2022 12:08
Notes about compilation time

When building programs with user interfaces*, there are parts that cannot be tested formally with either types or automated tests, because they require a human to test how things "feel."

In that context, long compile times lengthen the build-evaluate feedback loop to a point that harms quality.

  • also note that APIs are user interfaces. So this harms way more than just programs with GUIs.

@url: https://www.youtube.com/watch?v=dnz6y5U0tFs Here he find it normal to build 1M loc of scheme code in 16minutes. "respectable compile time" (It used to be 4min!)

@url: tool by Aras https://github.com/aras-p/ClangBuildAnalyzer

@uucidl
uucidl / bitwise-notes-62.md
Created February 20, 2019 10:24
bitwise-notes.md

Bitwise Day 62: Indexed Arrays

Per worked 20h since Day 61.

How do we get a good story for dynamic arrays? What we called stretchy bufs (buf_... API)

Added many new intrinsics to gen_intrinsic:

  • apush, kadd, kdget, kdel
  • hget, hdel
@uucidl
uucidl / ibbq-thermometer-protocol.md
Last active August 27, 2023 22:21
ibbq-thermometer-protocol

Example devices

  • Inkbird IBT-2X
  • Inkbird IBT-4XS
  • EasyBBQ FCCID: FCC ID 2AI4MPRO3 (SHENZHEN HYPERSYNES CO.,LTD Smart Wireless Thermometer PRO3)

Properties

  • @ConnectTimeout: 60 seconds
  • @BatteryPollingInterval: 5 minutes

The iBBQ is a Bluetooth LE Gatt Device