Skip to content

Instantly share code, notes, and snippets.

View charlesetc's full-sized avatar
🪁
Flying kites in NYC

Charles Chamberlain charlesetc

🪁
Flying kites in NYC
View GitHub Profile
@charlesetc
charlesetc / strace -f utop
Created November 13, 2016 07:38
strace -f utop
execve("/home/charles/.opam/4.02.3/bin/utop", ["utop"], [/* 62 vars */]) = 0
brk(NULL) = 0xbc3000
access("/etc/ld.so.preload", R_OK) = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=147833, ...}) = 0
mmap(NULL, 147833, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f9ca06b5000
close(3) = 0
open("/usr/lib/libm.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\2\1\1\3\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0pU\0\0\0\0\0\0"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1067376, ...}) = 0
diff --git a/src/preproc/eqn/lex.cpp b/src/preproc/eqn/lex.cpp
index b6f15bd..2f2a759 100644
--- a/src/preproc/eqn/lex.cpp
+++ b/src/preproc/eqn/lex.cpp
@@ -239,6 +239,25 @@ static struct builtin_def common_defs[] = {
{ "cdot", "type \"binary\" \\(md" },
{ "cdots", "type \"inner\" { \\(md \\(md \\(md }" },
{ "dollar", "$" },
+ { "emdash", "\\[em]"},
+ { "endash", "\\[en]"},
use "options"
use "path:sys/ioctl"
use @ioctl[None](file: I32, magic: U32, winsize: MaybePointer[Winsize])
struct Winsize
var height: U16 = 0
var width: U16 = 0
new create() => None
$ pulseaudio
W: [pulseaudio] pid.c: Stale PID file, overwriting.
E: [pulseaudio] module-device-restore.c: Failed to open volume database '/home/charles/.config/pulse/fcc78b8e9d024418a028525a0943d256-device-volumes': Permission denied
E: [pulseaudio] module.c: Failed to load module "module-device-restore" (argument: ""): initialization failed.
E: [pulseaudio] hook-list.c: Assertion '!slot->dead' failed at pulsecore/hook-list.c:83, function pa_hook_slot_free(). Aborting.
[1] 1989 abort pulseaudio
@charlesetc
charlesetc / nspace
Last active May 25, 2017 16:32
Use pandoc to build directory md->html
#!/bin/bash
name=$(basename $(pwd))
style=kate
flags=" -s --highlight-style $style"
if [ -f "$name.html" ] ; then
flags="$flags -A $name.html "
@charlesetc
charlesetc / brie.vim
Created July 5, 2017 12:41
Simple syntax highlighting for Brie
if exists("b:current_syntax")
finish
endif
" Keywords
syntax keyword brieKeyword class define case self method field require
highlight link brieKeyword Keyword
" Block
build-c:
clang -fPIC -Wall -Wextra -O3 -g -MM stars_extension.c >stars_extension.d
clang -fPIC -Wall -Wextra -O3 -g -c -o stars_extension.o stars_extension.c
clang -shared -o libstars_extension.dylib stars_extension.o
@charlesetc
charlesetc / compmisc_example.ml
Created April 25, 2018 04:56
OCaml compiler variation
(* 4.06 *)
let initial_env () =
Ident.reinit();
let initial =
if Config.safe_string then Env.initial_safe_string
else if !Clflags.unsafe_string then Env.initial_unsafe_string
else Env.initial_safe_string
in
let env =
@charlesetc
charlesetc / objects.ml
Created July 30, 2018 02:35
Somwhat complex use of objects in OCaml
let rec non_empty_list next prev value =
object (self)
val mutable next = next
val mutable prev = prev
val mutable value = value
method append value =
let l = non_empty_list next (Some self) value in
next <- Some l
@charlesetc
charlesetc / Uncertainty is the mind-killer
Created September 24, 2018 00:04
Dune output upon crashing
I must not segfault. Uncertainty is the mind-killer. Exceptions are
the little-death that brings total obliteration. I will fully express
my cases. Execution will pass over me and through me. And when it
has gone past, I will unwind the stack along its path. Where the
cases are handled there will be nothing. Only I will remain.