Skip to content

Instantly share code, notes, and snippets.

View dkapitan's full-sized avatar

Daniel Kapitan dkapitan

View GitHub Profile
@dkapitan
dkapitan / awesome-python-rust.md
Last active November 21, 2023 08:36
awesome-python-rust

Upcoming Python libraries with a Rust runtime that are useful for the composable data stack:

  • greptime: an open-source, cloud-native, distributed time-series database with PromQL/SQL/Python supported
  • tokenizers: fast state-of-the-art tokenizers from Huggingface optimized for research and production
  • pixi: package management tool for developers, build on top of the conda packaging ecosystem
  • polars: lightning-fast DataFrame library for Rust and Python
  • pydantic: most widely used data validation library for Python, implemented in Rust since v2
  • robyn: fast, innovator friendly, and community driven Python-Rust web framework
  • RustPython: RustPython is a Python interpreter written in Rust. RustPython can be embedded into Rust programs to use Python as a scripting language for your application
@dkapitan
dkapitan / requirements.txt
Last active October 31, 2023 13:55
Base pyenv with jupyterlab
black
ipywidgets
isort
jedi-language-server
jupyterlab
jupyterlab_pygments
jupyterlab_rise
pygments
@dkapitan
dkapitan / add-kernel.sh
Created October 24, 2023 10:30
Add poetry .venv as Jupyter kernel
poetry run python -m ipykernel install --user --name pymedphys
@dkapitan
dkapitan / quarto-theme.scss
Last active August 6, 2023 08:51
Mozilla design
// Google Fonts
@import url(http://fonts.googleapis.com/css?family=Zilla+Slab|Zilla+Slab+Highlight|Inter|Fira+Code:400italic,700italic,400,700);
// Font Variables
$zilla-slab: "Zilla Slab", serif;
$zilla-slab-highlight: "Zilla Slab Highlight", serif;
$inter: "Inter", sans-serif;
$fira-code: "Fira Code";
// Colours
@dkapitan
dkapitan / conda.yml
Last active September 1, 2023 11:03
Voltron stack: polars, pandas 2.0, altair 5.0
name: python-data-science
channels:
- conda-forge
dependencies:
- python=3.10
- adlfs
- altair==5.0.1
- black
- ipykernel
- matplotlib
@dkapitan
dkapitan / Dockerfile
Last active January 11, 2023 13:24 — forked from alonisser/Dockerfile
Dockerfile for spacy prodigy for cloud setup using remote postgresql including changing instructions file and overriding index.html - and the leanest I've got
FROM python:3.6-alpine
# Opted for alpine to get a lean docker image as possible
RUN apk add --no-cache openssl
ENV DOCKERIZE_VERSION v0.6.1
RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& tar -C /usr/local/bin -xzvf dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& rm dockerize-alpine-linux-amd64-$DOCKERIZE_VERSION.tar.gz
# Python deps for alpine
@dkapitan
dkapitan / keyboard-shortcuts-windows-11.md
Last active May 3, 2022 09:56
Keyboard shortcuts Windows 11
context shortcut action
desktop ctrl + super + ←/→ switch to desktop left/right
shift + super + ←/→ move active window to display left/right
super + tab show virtual desktops
ctrl + super + D create new virtual desktop
browsing ctrl + shift + L auto-fill username and password with Bitwarden
ctrl + shift + M switch Chrome profile
@dkapitan
dkapitan / cibg-big-register.py
Created March 3, 2022 10:07
Using zeep to query SOAP
from zeep import Client
client = Client("https://webservices.cibg.nl/Ribiz/OpenbaarV4.asmx?wsdl")
client.service.ListHcpApprox4(WebSite="Ribiz", Name="Kerkhoven", Initials="M")
@dkapitan
dkapitan / sparse_matrix_to_tensor.py
Created January 23, 2022 22:25
Convert SciPy sparse matrix to tf.sparse.SparseTensor
def sparse_matrix_to_tensor(X):
"""Transforms SciPy sparse matrix to tensorflow.sparse.SparseTensor."""
row_nnz = np.diff(X.indptr)
indices = np.asarray([[row_i, col_i]
for row_i, nnz in enumerate(row_nnz)
for col_i in range(nnz)], dtype=np.int64)
values = X.data
return SparseTensor(indices=indices, values=values, dense_shape=X.shape)
@dkapitan
dkapitan / config-wsl-ubuntu.md
Last active January 8, 2022 14:37
configuration wsl ubuntu

Base image

  • install Windows Terminal
  • install wsl
  • install Ubuntu
  • sudo apt update && sudo apt upgrade
  • install Homebrew
  • install pyenv
  • install oh-my-posh
  • install jump