Skip to content

Instantly share code, notes, and snippets.

Create a new project

poetry new <project-name>

Initialise an existing project

poetry init 

Add a new lib (prod & dev)

@expobrain
expobrain / bash-path-vars
Created March 11, 2019 12:52 — forked from caruccio/bash-path-vars
Path manipulation with bash vars
$ FILE=/some/path/to/file.txt
###################################
### Remove matching suffix pattern
###################################
$ echo ${FILE%.*} # remove ext
/some/path/to/file
$ FILE=/some/path/to/file.txt.jpg.gpg # note various file exts
@expobrain
expobrain / commit.py
Created January 9, 2019 18:25 — forked from danielmt/commit.py
pygit 2 snippets - most examples assume using a bare repository.
import pygit2
# open existing repository
repo = pygit2.Repository(pygit2.discover_repository('test_repos'))
# check if repos is newly created
if repo.head_is_unborn:
tb = repo.TreeBuilder()
parent = []
else: