Better HN
topnewbestaskshowjobs
Log inSign up

tandav

490 karma · joined Nov 5, 2016 (10y ago) · 183 submissions

Music Nerd https://rodionov.cc
Submissions

comment 1y ago · link · parent

Still no option to store virtual envs outside projects after a year

https://github.com/astral-sh/uv/issues/1495

comment 1y ago · link · parent

I'm waiting for this issue to be done: Add an option to store virtual environments in a centralized location outside projects https://github.com/astral-sh/uv/issues/1495

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)

comment 2y ago · link · parent

As an admin of my personal website, I completely disable all Cloudflare features and use it only for DNS and domain registration. I also stop following websites that use Cloudflare checks or cookie popups (cookies are fine, but the popups are annoying).

comment 2y ago · link · parent

The lack of s3-like remotes support was the reason I switched from borg to restic

comment 2y ago · link · parent

Also Atom feeds supports pagination https://www.rfc-editor.org/rfc/rfc5005#section-3

comment 2y ago · link · parent

Yes, dystopian soulless vibe of AI images is unpleasant.

comment 2y ago · link · parent

There is also virtualenvwrapper. It’s quite handy to create, list, remove virtual environment. I prefer to store all venvs in ~/.cache/virtualenvs instead of .venv in project directory, makes it more clean, no need to exclude for backups or git repository.

https://virtualenvwrapper.readthedocs.io/en/latest/

comment 2y ago · link · parent

It's annoying that there's no easy way to export data from the Apple Watch. The only option is to export complete data from the Apple Health app, which results in a large ZIP file. This file takes about 10 minutes of preprocessing before the whole archive becomes available. It would be much better if I could export only the new records, like those from the last day.

comment 2y ago · link · parent

It would be nice to have some sort of demo

comment 2y ago · link · parent

Imagine Google removes RSS for YouTube channels

comment 2y ago · link · parent

shameless plug: I maintain a small library to do functional pipes. You can write:

    (
        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/

12.

EffVer: Version your code by the effort required to upgrade(jacobtomlinson.dev ↗)

3 points · by tandav · 2y ago · 1 comment

comment 2y ago · link · parent

You can also use

    HISTCONTROL=ignoreboth
to use both ignorespace and ignoredups

comment 2y ago · link · parent

I found it difficult to find documentation on how to run gitlab in docker without nginx (I use caddy for reverse proxy) and enable the registry. For anyone having the same problem, here's a working Dockerfile. https://gitlab.tandav.me/tandav/notes/-/issues/5516

I've tried github actions, drone, woodpecker and gitlab. In my opinion gitlab has a much more flexible CI system.

comment 3y ago · link · parent

Does anyone know vscode extension that can use OpenAI API to perform code completions like Copilot?

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.

comment 3y ago · link · parent

I wish they make it possible to use any, callable builtins for type annotations

comment 3y ago · link · parent

If you need just reverse proxy, Caddyfile syntax looks simpler:

    myapp.company.com {
        reverse_proxy localhost:3000
    }

comment 3y ago · link · parent

TIL there's git notes https://git-scm.com/docs/git-notes

comment 3y ago · link · parent

Side question: Does anyone know a simple caddy-like solution, but for non-HTTP traffic? For example, I want automatic SSL certificates for redis, mongodb, postgresql.

comment 3y ago · link · parent

(2013)

comment 3y ago · link · parent

My library solves 2 problems.

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)

comment 3y ago · link · parent

shameless plug: I maintain a small library to do functional pipes.

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/

comment 3y ago · link · parent

I recommend shellcheck and shfmt pre-commit hooks:

  - 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]

comment 3y ago · link · parent

To support multiple PIDs: killport() { lsof -ti :"$1" | xargs kill -9; }

comment 3y ago · link · parent

I wrote a script to clean Google search url and keep only q param https://github.com/tandav/blog/blob/master/posts/clean_googl...

comment 3y ago · link · parent

also try mamba which is much faster than conda https://mamba.readthedocs.io/en/latest/index.html

comment 3y ago · link · parent

* https://virtualenvwrapper.readthedocs.io

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
    }

comment 3y ago · link · parent

I use https://github.com/navidrome/navidrome and it’s great

comment 4y ago · link · parent

Gitea will support federation soon https://github.com/go-gitea/gitea/issues/18240
1234567