490 karma · joined November 5, 2016
I have used virtualenvwrapper before and it was very convenient to have all virtual environments stored in one place, like ~/.cache/virtualenvs.
The .venv in the project directory is annoying because when you copy folder somewhere you start copying gigabytes of junk. Some tools like rsync can't handle CACHEDIR.TAG (but you can use --exclude .venv)
(
range(10)
| Map(lambda x: x * 10)
| Filter(lambda x: x % 2 == 0)
| Reduce(lambda a, b: a + b)
)
and more. https://tandav.github.io/pipe21/most operators are basically oneliners: https://github.com/tandav/pipe21/blob/master/pipe21.py#L17
I also maintain a list of libraries which uses pipeline/chain syntax: https://tandav.github.io/pipe21/similar-tools/
HISTCONTROL=ignoreboth
to use both ignorespace and ignoredupsI've tried github actions, drone, woodpecker and gitlab. In my opinion gitlab has a much more flexible CI system.
There are several ChatGPT-like UIs that you can self host and pay only for API and not for ChatGPT plus. For example, I'm using https://github.com/Yidadaa/ChatGPT-Next-Web. It would be nice to use Copilot in the same way.
myapp.company.com {
reverse_proxy localhost:3000
}1. It does not require to wrap your iterable into some wrapper to use functional methods. It takes an iterable/object and returns another iterable/object. You don't have to unwrap it after transformations.
2. it uses oneliners (library is 80LOC single file) for most of the methods. You can just copy-paste it to use instead of install and import. E.g map, filter, reduce is just:
class B:
def __init__(self, f): self.f = f
class Pipe (B): __ror__ = lambda self, x: self.f(x)
class Map (B): __ror__ = lambda self, x: map (self.f, x)
class Filter(B): __ror__ = lambda self, x: filter(self.f, x)
class Reduce(B): __ror__ = lambda self, it: functools.reduce(self.f, it, *self.args)You can write:
(
range(10)
| Map(lambda x: x * 10)
| Filter(lambda x: x % 2 == 0)
| Reduce(lambda a, b: a + b)
)
instead of: x = range(10)
x = map(lambda x: x * 10, x)
x = filter(lambda x: x % 2 == 0, x)
x = reduce(lambda a, b: a + b, x)
and more. https://tandav.github.io/pipe21/ - repo: https://github.com/shellcheck-py/shellcheck-py
rev: v0.9.0.2
hooks:
- id: shellcheck
args: [-e, SC2154, -e, SC1091, -e, SC1090]
- repo: https://github.com/scop/pre-commit-shfmt
rev: v3.6.0-2
hooks:
- id: shfmt # requires Go to build
args: [-i, '4', -ci, -sr, -w, -s]also alias to create jupyter kernel for activated environment:
mkkernel() {
if [ -n "$1" ]; then
KERNEL_NAME=$1
elif [ -z "$VIRTUAL_ENV" ]; then
echo "Pass either kernel name as argument or activate virtualenv"
return 1
else [ -z "$1" ]
KERNEL_NAME="$(basename $VIRTUAL_ENV)"
echo "No kernel name provided, using name from virtualenv $KERNEL_NAME"
fi
pip install ipykernel
python -m ipykernel install --user --name=$KERNEL_NAME
}According to this blog post https://a.exozy.me/posts/gitea-actually-joins-the-fediverse/