Skip to content

Instantly share code, notes, and snippets.

View niderhoff's full-sized avatar

Nicolas Iderhoff niderhoff

View GitHub Profile
@niderhoff
niderhoff / autoenv.sh
Created July 29, 2021 08:26
auto venv bash
# venv
function deactivate_venv() {
parentdir=$(dirname "${VIRTUAL_ENV}")
if [[ "$PWD"/ != "$parentdir"/* && -n "$(command -v deactivate)" ]] ; then
echo "Deactivating ${VIRTUAL_ENV}"
deactivate
activate_venv
fi
}
function activate_venv() {
@niderhoff
niderhoff / README.md
Last active June 30, 2021 10:23
VS Code Attach to running container fromCLI

Attach to VS Code Running Container from CLI

Usage:

chmod +x code_attach
code_attach <container_name> <path> <docker_context>
  • container_name: name of the running container