Python

Anaconda

Create an environment spec file (operating system specific)

conda list --explicit > spec_file.txt

cloning an environment

conda create --name myclone --clone myenv

removing an environment

conda remove --name myenv --all

General

Compatible type hints across various versions

Place the following at the top of the module

from __future__ import annotations

See this stack overflow link here for more details and the python docs

Greek letters

Python has support for unicode fonts, source

>>> print('Omega: \u03A9')
Omega: Ω
>>> print('Delta: \u0394')
Delta: Δ
>>> print('sigma: \u03C3')
sigma: σ
>>> print('mu: \u03BC')
mu: μ
>>> print('epsilon: \u03B5')
epsilon: ε
>>> print('degree: \u00B0')
degree: °
>>> print('6i\u0302 + 4j\u0302-2k\u0302')
6î + 4ĵ-2k̂

Automatically reload modules in jupyter notebook

# reload modules if there is a change
%load_ext autoreload
%autoreload 2

Place in top cell where modules are imported - useful for rapid testing and development of a python package

plot legend position

import matplotlib.pyplot as plt

plt.legend(loc='upper right')

Git

Commit messages

The commit type can include the following:

Example:

feat: improve performance with lazy load implementation for images

Source: free code camp: how-to-write-better-git-commit-messages

Libre Office - Impress

Create an image with rounded corners

LaTex

Large and archaic but for some reason people love it Installation on local machine:

https://www.tug.org/texlive/

Best off download the largest package, don’t bother with basictex or tiny tex. Just get the full TexLive and MacTex

Inkscape

Crop an image in inkscape

1. Open Your Image in Inkscape.
2. Select a Vector Shape.
3. Add the Shape to the Canvas.
4. Reduce the Shape Opacity to Position the Crop.
5. Select the Shape and the Image Together.
6. Go to Object > Clip > Set Clip.
7. Check the Crop.
8. Release the Clip (if Needed)

Source: imagy.app