This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#include <epoxy/gl.h> | |
#include <cassert> | |
#include <memory> | |
#include <numeric> | |
#include <type_traits> | |
template <GLenum Type, typename Ptr = void *> | |
struct buffer { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef BMPLDR_H | |
#define BMPLDR_H | |
#include <stdint.h> | |
#include <stddef.h> | |
#include <stdbool.h> | |
#ifdef __cplusplus | |
extern "C" { | |
#endif |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
#include <stddef.h> | |
#define __USE_GNU | |
#include <signal.h> | |
#include <ucontext.h> | |
#define OBJ_MAGIC_HIGH 0xDEADBEEF00000000 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <iomanip> | |
#include <vector> | |
#include <string> | |
#include <string_view> | |
#include <elf.h> | |
struct symbol { | |
std::string_view name; | |
uintptr_t base; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <fstream> | |
#include <vector> | |
#include <algorithm> | |
#include <span> | |
#include <cstdint> | |
#include <type_traits> | |
#include <cassert> | |
#include <cstring> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdarg.h> | |
#include <stddef.h> | |
#include <stdint.h> | |
#include <ctype.h> | |
#define FMT_PUT(dst, len, c) {\ | |
if(!(len) && check_bounds) goto end;\ | |
*(dst)++ = (c);\ | |
len--;\ | |
ret++;\ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#include <string> | |
#include <algorithm> | |
#include <sys/types.h> | |
#include <sys/wait.h> | |
#include <sys/mman.h> | |
#include <unistd.h> | |
#include <fcntl.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Compile with: gcc term.c -o term -lX11 ... | |
#define _XOPEN_SOURCE 600 | |
#include <X11/Xlib.h> | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <fcntl.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <poll.h> | |
#include <sys/ioctl.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from bdfparser import Font # https://github.com/tomchen/bdfparser | |
# Character 0 (NUL) was changed from 0x0000 to 0x0020 (space) | |
# Character 255 (NBSP) was changed from 0x00A0 to 0x0020 (space) | |
cp437_mapping = [ | |
0x0020, 0x263A, 0x263B, 0x2665, 0x2666, 0x2663, 0x2660, 0x2022, | |
0x25D8, 0x25CB, 0x25D9, 0x2642, 0x2640, 0x266A, 0x266B, 0x263C, | |
0x25BA, 0x25C4, 0x2195, 0x203C, 0x00B6, 0x00A7, 0x25AC, 0x21A8, | |
0x2191, 0x2193, 0x2192, 0x2190, 0x221F, 0x2194, 0x25B2, 0x25BC, | |
0x0020, 0x0021, 0x0022, 0x0023, 0x0024, 0x0025, 0x0026, 0x0027, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(use-modules (ice-9 textual-ports) (srfi srfi-1) (ice-9 string-fun)) | |
(define (read-all-lines) | |
(let ([line (get-line (current-input-port))]) | |
(if (eof-object? line) | |
'() | |
(cons line (read-all-lines))))) | |
(define WORD->DIGIT | |
'(("one" . "1") |