Skip to content

Instantly share code, notes, and snippets.

@peterroelants
peterroelants / hv_cmap_alpha.ipynb
Last active July 14, 2021 15:17
Holoviews Bokeh cmap alpha not working
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@peterroelants
peterroelants / Dockerfile
Last active May 2, 2021 10:54
Build minimal Python environment with Pydantic
# Build with:
# DOCKER_BUILDKIT=1 docker build --progress=plain --target pydantic_env --tag pydantic-test-env --file ./pydantic/pydantic.static.Dockerfile .
#
# Uses multi-stage builds.
#
# Stage 1: Temporarity builder
FROM python:3.9.2-slim-buster as builder
ARG PYDANTIC_VERSION=1.8.1
@peterroelants
peterroelants / jax_conda_env.yml
Last active April 5, 2021 11:41
JAX FFT Convove
name: jax_deps
channels:
- conda-forge
dependencies:
- flake8
- jaxlib
- jupytext
- jupyter-sphinx
- matplotlib
- mypy
@peterroelants
peterroelants / alluxio.fuse.compose.yml
Created March 12, 2021 09:09
Alluxio with FUSE container setup based on Alluxio Documentation
# Alluxio Docker Deployment
# Based on "Using User-Defined Network" configuration from:
# https://docs.alluxio.io/os/user/stable/en/deploy/Running-Alluxio-On-Docker.html
version: '3.8'
networks:
alluxio-network:
name: alluxio-network
driver: bridge
@peterroelants
peterroelants / docker-compose.yml
Last active February 25, 2021 18:25
Alluxio glasfish error
# Alluxio Docker Deployment
# Based on "Using User-Defined Network" configuration from:
# https://docs.alluxio.io/os/user/stable/en/deploy/Running-Alluxio-On-Docker.html
version: '3.8'
networks:
alluxio_network:
name: alluxio_network
driver: bridge
@peterroelants
peterroelants / pip_compile_snippet.Dockerfile
Created February 12, 2021 09:58
Reduce python container size by compiling with pip
# Install python packages with pip using compilation to reduce size
# - https://towardsdatascience.com/how-to-shrink-numpy-scipy-pandas-and-matplotlib-for-your-data-product-4ec8d7e86ee4
# - https://avilpage.com/2020/02/reduce-python-package-footprint.html
# - https://stackoverflow.com/a/22942120
# - https://blog.mapbox.com/aws-lambda-python-magic-e0f6a407ffc6
# `/usr/local/bin/python3-config --cflags` should be applied automatically, the
# following flags extend these.
RUN pip install --upgrade pip \
&& export CFLAGS="${CFLAGS} -g0 -Wl,--strip-all -Os -I/usr/include:/usr/local/include" \
&& export LDFLAGS="${LDFLAGS} -L/usr/lib:/usr/local/lib" \
@peterroelants
peterroelants / Dockerfile
Created January 24, 2021 14:52
tini standalone docker install
# Install tini for entrypoint
# More info:
# - https://github.com/krallin/tini
# Checksum from https://github.com/krallin/tini/releases/download/v0.19.0/tini.sha256sum
ARG TINI_DOWNLOAD_URL=https://github.com/krallin/tini/releases/download/v0.19.0/tini
ARG TINI SHA256HASH="93dcc18adc78c65a028a84799ecf8ad40c936fdfc5f2a57b1acda5a8117fa82c"
ADD ${TINI_DOWNLOAD_URL} /opt/runtime/tini
RUN if ! echo "${SHA256HASH} /opt/runtime/tini" | sha256sum --check --status ; then exit 1 ; fi && \
chmod +x /opt/runtime/tini
@peterroelants
peterroelants / setup_conda.sh
Last active January 23, 2021 11:53
Install conda, install environment, and export environment with conda-pack. (Intended for Docker containers)
#!/usr/bin/env bash
# Use Bash strict mode
# Exit immediately if command or pipe fails, and treat unset variables as an error.
# More info:
# - https://linuxcommand.org/lc3_man_pages/seth.html
# - http://redsymbol.net/articles/unofficial-bash-strict-mode/
##############################################################################
set -euo pipefail
@peterroelants
peterroelants / .p10k.zsh
Last active January 6, 2021 07:44
zshrc
# Generated by Powerlevel10k configuration wizard on 2020-12-15 at 18:06 CET.
# Based on romkatv/powerlevel10k/config/p10k-classic.zsh, checksum 45530.
# Wizard options: nerdfont-complete + powerline, small icons, classic, unicode, darkest,
# 24h time, angled separators, sharp heads, flat tails, 1 line, compact, few icons,
# concise, transient_prompt, instant_prompt=verbose.
# Type `p10k configure` to generate another config.
#
# Config for Powerlevel10k with classic powerline prompt style. Type `p10k configure` to generate
# your own config based on it.
#
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.