Skip to content

Instantly share code, notes, and snippets.

@deadpixi
deadpixi / keys.py
Last active October 21, 2022 15:24
A minimal set of input key sequences that covers a wide variety of terminals...
{'kcub1': {'\\E[217z', '\\EOD', '\\E[D', '\\ED'},
'kcud1': {'\\EB', '\\E[221z', '\\E[B', '\\EOB'},
'kcuf1': {'\\EC', '\\E[219z', '\\EOC', '\\E[C'},
'kcuu1': {'\\EOA', '\\E[A', '\\E[215z', '\\EA'},
'kend': {'\\EF',
'\\EOF',
'\\E[146q',
'\\E[220z',
'\\E[4~',
'\\E[8~',
@deadpixi
deadpixi / thebe.c
Last active January 14, 2024 18:26
An insertion-order-preserving hash table in C, as part of the Thebe scripting language (which I will eventually get around to finishing).
#include <math.h>
#include <stdint.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include "thebe.h"
/*** TODO
* - switch tables to use uint32_t indexes; that's big enough for anybody, maybe even consider using