Skip to content

Instantly share code, notes, and snippets.

View MultisampledNight's full-sized avatar

multisn8 MultisampledNight

View GitHub Profile
#!/usr/bin/env sh
cd $(git rev-parse --show-toplevel)
mkdir -p compiled-docs
export TYPST_ROOT="$(pwd)/docs"
for document in $(find -path "./docs/*.typ" -not -path "*/util/*"); do
typst compile $document \
--input "production=true" \
$@
@MultisampledNight
MultisampledNight / sildize.typ
Created April 9, 2024 20:39
heading → slide converter for typst
#import "@preview/polylux:0.3.1": *
#set text(font: "IBM Plex Sans")
#import themes.simple: *
#show: simple-theme
#enable-handout-mode(true)
// Splits the array `it`
// on each item where `check` returns `true`.

Codified https://www.youtube.com/watch?v=N6b44kMS6OM from 2019

Traditionally

A compiler has a pipeline of passes:

  • ==lexing== the ==source== to get ==tokens==
  • ==parsing== the ==tokens== to get the ==AST==
  • semantically analyzing the ==AST==, type checking the ==AST==
  • applying optimizations
@MultisampledNight
MultisampledNight / latex-to-svg.py
Created September 6, 2022 21:33
LaTeX file path as command line argument to SVG on stdout in the worst possible version (impure)
#!/usr/bin/env python
# Takes a filename of a LaTeX file as argv[1] and prints the resulting svg on
# stdout. Impure, depends on pdflatex and pdf2svg, creates a temporary dir.
import re
import subprocess
import sys
import tempfile
from pathlib import Path
@MultisampledNight
MultisampledNight / subject.txt
Created July 21, 2022 13:37
Random nonsensical text, don't even ask
vim: tw=100
This is just nonsense text, hopefully long enough to actually match at least some part of the actual
text on the dashboard. Else, I really don't know what to write here. But I need to keep writing to
reach that one spot where the highlight actually "burns in". But how can that happen? How can I
write that long for the text to become long enough for the TUI to ignore the highlight of the
shortcut, but any GUI still displaying it? Right, sometimes we're all just writing nonsense in order
to let time pass. But is that the only reason we're writing such text? Possible. For now, I'll
duplicate this paragraph because I'm too bored to write more of this nonsense.
This is just nonsense text, hopefully long enough to actually match at least some part of the actual
@MultisampledNight
MultisampledNight / error.log
Created June 10, 2022 17:11
LSP log upon random error in NeoVim (see rust-lang/rust-analyzer#12482)
[ERROR][2022-06-10 19:05:30] .../vim/lsp/rpc.lua:534 "No callback found for server response id 3"
[ERROR][2022-06-10 19:05:30] .../lua/vim/lsp.lua:824 "LSP[rust_analyzer]" "on_error" { code = "NO_RESULT_CALLBACK_FOUND", err = { id = 3, jsonrpc = "2.0", result = { isIncomplete = true, items = { { additionalTextEdits = {}, deprecated = false, filterText = "self::", kind = 14, label = "self::", preselect = true, sortText = "ffffffef", textEdit = { insert = { end = { character = 36, line = 234 }, start = { character = 36, line = 234 } }, newText = "self::", replace = { end = { character = 36, line = 234 }, start = { character = 36, line = 234 } }
@MultisampledNight
MultisampledNight / quick-neovim-nightly.zsh
Last active April 21, 2021 19:21
Get NeoVim Nightly quickly
#!/usr/bin/zsh
echo "Make sure you've installed 'libtermkey' 'msgpack-c' 'libvterm' 'libluv' 'libtree-sitter.so' 'git' 'cmake' 'ninja' 'lua51-mpack' 'lua51-lpeg' and 'gperf'. This depends on your package manager. Press Ctrl + C to abort if you haven't installed the dependencies yet. (Most likely you haven't gotten tree-sitterdev or similar yet)"
sleep 4
# prepare
git clone https://github.com/neovim/neovim.git
cd neovim
git reset --hard nightly