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
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 = []
@tef
tef / photo.md
Last active January 19, 2024 03:24

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

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

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 
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`
@tef
tef / vex
Created April 24, 2018 15:50
$ vex
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`
@tef
tef / README.md
Last active April 17, 2018 02:45

undo/redo persistent example

$ ./undo.py do 1
do: 1

$ ./undo.py do 2
do: 2

$ ./undo.py do 3
import csv
import collections
import datetime
dates = {}
with open('tweets.csv') as fh:
fh.readline()
reader = csv.reader(fh)
for row in reader: