Skip to content

Instantly share code, notes, and snippets.

View dkapitan's full-sized avatar
☸️

Daniel Kapitan dkapitan

☸️
View GitHub Profile
@dkapitan
dkapitan / query_pdok.py
Created June 17, 2024 11:03
Python script for Google Sheets Neptyne plugin to find lat-lon with pdok
import re
import requests
import urllib
PDOK = "https://api.pdok.nl/bzk/locatieserver/search/v3_1/free"
def query_pdok(query):
query_params = {
@dkapitan
dkapitan / redact_patient.py
Created June 14, 2024 19:00
Simple redacting of FHIR patient resource in ndjson
import ndjson
def redact(patient: dict) -> dict:
for key in ["name", "telecom"]:
patient.pop(key, None)
return patient
with open("patient.ndjson") as f:
@dkapitan
dkapitan / roonserver.md
Last active June 17, 2024 06:16
Runing Debian 12 as a server

Objectives

  • Get to know Debian with very minimal install to run RoonServer
  • Use Debian as Linux Docker Engine platform for dev/test

Debian 12 setup

  • Download Debian live standard (no desktop manager, link)
  • add user to sudo
  • su root
@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