commit 1a813f9b7c1c9492e07a1a9df83c997f6b4a49b8
parent d81fb80c58d1005c200a29933846826f17051714
Author: gearsix <gearsix@tuta.io>
Date: Fri, 18 Mar 2022 00:24:12 +0000
added pyserve
Diffstat:
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/README.md b/README.md
@@ -75,6 +75,7 @@ Useful for debugging somebody else's code in a terminal.
**tooling**
+- *pyserve* - shorthand for `python3 -m http.server --directory $1`
- *git-cfg* - shorthand for setting git config --local user.name $1 && git config --local user.email $2
- You can also use it for setting global config using `-g`
- *git-clone-bulk* - clone a list of git repositories
@@ -85,7 +86,6 @@ Useful for debugging somebody else's code in a terminal.
**misc**
-- *xbright* - set the screen brightness using _xrandr_
- *shush* - echo output of $@ to null
- *pomodoro* - a [pomodoro](https://en.wikipedia.org/wiki/Pomodoro_Technique) timer.
- *while-true* - clear the terminal, run $1 sleep ($2 || 1 sec), repeat forever (Ctrl+C to cancel)
diff --git a/nix/pyserve.py b/nix/pyserve.py
@@ -0,0 +1,7 @@
+#!/usr/bin/env sh
+
+dir="."
+
+if [ $1 ]; then dir=$1; fi
+
+python3 -m http.server --directory $dir