Skip to content

Instantly share code, notes, and snippets.

View tef's full-sized avatar
💭
Please don't try to contact me over GitHub.

tef tef

💭
Please don't try to contact me over GitHub.
View GitHub Profile
sycamore:demo tef$ vex help
Name: vex -- a database for files
Usage: vex [help] <init|undo|redo|status|log|diff|...> [--help]
Description: vex is a command line program for saving changes to a project, switching
between different versions, and sharing those changes.
vex supports bash completion: run `complete -o nospace -C vex vex`

tab completion

a vex command can have multiple parts: vex name:subname:subsubname --args .., and the subnames are grouped, and have aliases.

grouping means that vex help prints them out in groups.

tab completing with no command shows all root commands, but not aliases:

sycamore:demo tef$ vex 

Here is an indented block:

One Space, One Tab
One Tab
 One Tab, One Space.
 Five Spaces

Now prefixed with '> ', Here the's the indented block:

'> ', One Space, One Tab

Blockquotes are awful in markdown, because they're semi optional in continuation lines.

There are three options i've considered:


Option A: Blockquote at start of para, and on every continuation line.

> a
@tef
tef / photo.md
Last active January 19, 2024 03:24
from contextlib import contextmanager
class Node:
def __init__(self, name, args, children):
self.name = name
self.args = args
self.children = children
def __str__(self):
out = []
func MakeFunc(out any) error {
handle := func(args []any) ([]any, error) {
// the func we're wrapping
return args
}
outFn := reflect.ValueOf(out).Elem()
outType := outFn.Type()
@tef
tef / undo.py
Last active February 11, 2025 13:12
"""
a write-ahead-log with undo and redo
undo and redo can be implemented atop list of actions, where
each new action adds onto the list, and undo removes it from
the list, and updates the predecessor with the new redo option,
and redo does the opposite process
say we have some history:
@tef
tef / histo.md
Created November 30, 2024 23:46

to be clear: histogram diff doesn't work like patience diff

By always selecting a LCS position with the lowest occurrence count, this algorithm behaves exactly like Bram Cohen's patience diff whenever there is a unique common element available between the two sequences.

This isn't true. It behaves the same when all unique tokens in the first file happen to be unique tokens in the second file. If the unique tokens in the first file aren't unique in the second file, histogram doesn't work like patience at all:

% cat a
2