Skip to content

Instantly share code, notes, and snippets.

View fcoclavero's full-sized avatar

Francisco Clavero fcoclavero

View GitHub Profile
@fcoclavero
fcoclavero / conda_cheatsheet.sh
Last active December 20, 2022 02:47
Conda cheatsheet
# Backup environment to file
conda env export --channel $ENV_NAME --file "$FILE_PATH.yaml"
# Clone conda env
conda create --name myclone --clone root
@fcoclavero
fcoclavero / mamba_cheatsheet.sh
Created October 24, 2022 19:31
Mamba cheatsheet
# Install Poetry 1.2
mamba install -c "conda-forge/label/cleo_dev" cleo
mamba install -c "conda-forge/label/poetry_dev" poetry=1.2
@fcoclavero
fcoclavero / cheatsheet.sh
Created November 4, 2022 16:09
Poetry cheatsheet
# Clear cache
poetry cache clear _default_cache --all
poetry cache clear pypi --all
# Get current speed
defaults read -g com.apple.mouse.scaling
# Set speed (maximum of 7.0)
defaults write -g com.apple.mouse.scaling 5.0
@fcoclavero
fcoclavero / get_value.sh
Last active December 20, 2022 02:59
Envfiles
# Get value on variable in .env file
cat .env | grep $VAR_NAME | sed 's/.*=//'
@fcoclavero
fcoclavero / decorators.py
Last active August 4, 2023 20:11
Django Cheatsheet
class SuppressExceptionsDecorator:
"""Decorator for temporarily suppressing specified exceptions.
Exception suppression is limited to the function execution.
Example:
```python
import warnings
@SuppressErrorsDecorator(MyException)
def foo():