News for hackers. Stuff that matters.

tandav

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

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

Re:Uv's killer feature is pulling in local dependencies on Monday January 13, 2025 @01:04AM (#42680535)
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)

Re:Using Cloudflare on your website could be blocking RSS users on Thursday October 17, 2024 @01:46PM (#41871860)
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).
The lack of s3-like remotes support was the reason I switched from borg to restic
Re:Full Text, Full Archive RSS Feeds for Any Blog on Monday September 02, 2024 @11:35AM (#41426322)
Also Atom feeds supports pagination https://www.rfc-editor.org/rfc/rfc5005#section-3
Yes, dystopian soulless vibe of AI images is unpleasant.
Re:Python Has Too Many Package Managers on Monday July 08, 2024 @03:41PM (#40908758)
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/

Re:Blog Posts, Sorted by Sleep on Sunday April 07, 2024 @01:39PM (#39962327)
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.
Re:Show HN: Free Plain-Text Bookmarking on Friday March 22, 2024 @11:50AM (#39791883)
It would be nice to have some sort of demo
Re:Google helped destroy adoption of RSS feeds (2023) on Saturday February 24, 2024 @03:06PM (#39494727)
Imagine Google removes RSS for YouTube channels
Re:Pipeline-Oriented Programming [video] on Saturday January 20, 2024 @04:26AM (#39065934)
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/

Re:I quit my job to work full time on my open source project on Wednesday January 10, 2024 @12:06PM (#38940721)
You can also use

    HISTCONTROL=ignoreboth
to use both ignorespace and ignoredups
Re:Evaluating New Software Forges on Sunday December 17, 2023 @12:18PM (#38674407)
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.

Re:GitHub Copilot Loses an Average of $20 per User per Month on Tuesday October 10, 2023 @09:52AM (#37832120)
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.

Re:Python 3.12 on Monday October 02, 2023 @02:14PM (#37742195)
I wish they make it possible to use any, callable builtins for type annotations
Re:Nginx Unit – Universal web app server on Sunday September 10, 2023 @02:23PM (#37458538)
If you need just reverse proxy, Caddyfile syntax looks simpler:

    myapp.company.com {
        reverse_proxy localhost:3000
    }
Re:git-appraise – Distributed Code Review for Git on Friday August 11, 2023 @01:11AM (#37085317)
Re:Easy HTTPS for your private networks on Monday July 10, 2023 @09:53PM (#36675554)
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.
Re:News Is Bad for You on Wednesday July 05, 2023 @09:50AM (#36600461)
(2013)
Re:Functional Python Programming on Friday June 09, 2023 @04:57PM (#36264071)
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)
Re:Functional Python Programming on Friday June 09, 2023 @10:42AM (#36258563)
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/
Re:Pure Sh Bible on Sunday April 30, 2023 @08:56PM (#35767994)
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]
To support multiple PIDs: killport() { lsof -ti :"$1" | xargs kill -9; }
Re:Google Search URL Request Parameters (2016) on Wednesday January 25, 2023 @01:47AM (#34515196)
I wrote a script to clean Google search url and keep only q param https://github.com/tandav/blog/blob/master/posts/clean_googl...
Re:Boring Python: Code Quality on Tuesday December 20, 2022 @01:00PM (#34069619)
also try mamba which is much faster than conda https://mamba.readthedocs.io/en/latest/index.html
Re:Ask HN: Programs that saved you 100 hours? (2022 edition) on Tuesday December 20, 2022 @12:46PM (#34069399)
* 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
    }
Re:Spotifyd on Tuesday December 20, 2022 @01:19AM (#34062260)
Re:Explore some of the finest open-source software out there on Sunday November 06, 2022 @04:38PM (#33497531)
Gitea will support federation soon https://github.com/go-gitea/gitea/issues/18240
Re:I wish my web server were in the corner of my room on Tuesday October 11, 2022 @02:11PM (#33166819)
termux (android) can run python, node, docker and more, but you should have static IP or some tunneling like cloudflare/tailscale/zerotier

Older »