Skip to content

Instantly share code, notes, and snippets.

@mariocesar
Last active August 4, 2024 13:53
Show Gist options
  • Save mariocesar/1b6ab784bde1f1fa47073c96566f6590 to your computer and use it in GitHub Desktop.
Save mariocesar/1b6ab784bde1f1fa47073c96566f6590 to your computer and use it in GitHub Desktop.
Useful oneliners that I often forget. #terminal #python #shell

direnv

List all the available functions in the standard lib:

direnv stdlib | grep -o -E "^(\w+)\(\)"
...
use_node()
use_nodenv()
use_nix()
use_flake()
use_guix()
use_vim()
direnv_version()
on_git_branch()

Git

Tag your commit with the current poetry version plus the git revision, semver compatible.

version="v$(poetry version --short)-rev.$(git rev-parse --short HEAD)"
git tag -a "$version" -m "Release $version"

How can I use SSH for Git on a network that blocks outbound SSH

In Github is easy, just convert this

git clone git@github.com:rtyley/small-test-repo.git

to this

git clone ssh://git@ssh.github.com:443/rtyley/small-test-repo.git

You will be able to clone the repository using SSH over port 443, which is typically open on most networks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment