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

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 October 21, 2024 00:14

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:
@tef
tef / catbus.md
Last active February 8, 2018 16:52

The Client

$ export CATBUS_URL='http://127.1:8888/test'
$ alias catbus='pipenv run python3 -m catbus.client'

$ catbus
DEBUG Fetching http://127.1:8888/test

    url: http://127.1:8888/test/
@tef
tef / twmrc
Created September 2, 2017 02:29
## tef's theme
#
# How to use my key config.
#
# On Desktop Windows
# Meta+Mouse1 = Move or Raise
# Meta+Mouse2 = Hide
# Meta+Mouse3 = Resize or Lower
#
# On Icon Bar
#!/bin/bash -x
PID=`docker run -v $(pwd):/workdir -d --privileged -i --rm ubuntu /bin/bash`
docker exec $PID apt-get -q -y update
docker exec $PID apt-get -q -y install debootstrap
docker exec $PID debootstrap --arch amd64 xenial /rootfs http://archive.ubuntu.com/ubuntu
docker exec $PID cp -r /rootfs/ /workdir
echo exit | docker attach $PID
echo "Dockerfile" > rootfs/.dockerignore
# tilda example
import ugfx
import buttons
import pyb
import math
from imu import IMU
ugfx.init()
buttons.init()
irb(main):056:0> Object::Object
=> Object
irb(main):057:0> Object.new::Object
TypeError: #<Object:0x007ff1fa842b48> is not a class/module
	from (irb):57
	from /usr/local/var/rbenv/versions/2.2.2/bin/irb:11:in `<main>'