Skip to content

Instantly share code, notes, and snippets.

@felixbd
felixbd / shell.nix
Created December 2, 2025 17:07
nix shell (dev env) for python3 and R
{ pkgs ? import <nixpkgs> {} }:
let
r_pkgs = with pkgs.rPackages; [
# ---- RMarkdown-related packages ----
knitr # Core package for dynamic report generation in R; integrates code, output, and text.
rmarkdown # Converts R Markdown files into HTML, PDF, or Word reports; supports reproducible documents.
tidyverse # Collection of packages for data science (ggplot2, dplyr, tidyr, readr, etc.).
viridis # Color palettes optimized for perceptual uniformity and colorblind-friendliness.
@felixbd
felixbd / progress_bar.py
Last active June 22, 2024 14:00
Simple progress bar in python3
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Simple progress bar.
Copyright (c) 2024 - Felix Drees - WTFPL
Do What the Fuck You Want to Public License
"""
@felixbd
felixbd / pytime.py
Created September 17, 2023 17:42
pytime
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
pytime.py - Display current time or countdown as ASCII art in the terminal
"""
# add to .zshrc
# alias pytime="$HOME/pytime.py"
@felixbd
felixbd / pdfsInDir2png.py
Created April 30, 2023 13:15
requires: pdfinfo (apt install poppler-utils) and pdf2image (pip3 install pdf2image)
#!/usr/bin/env python3
import os
import glob
from pdf2image import convert_from_path
# Get a list of all PDF files in the current directory
pdf_files = glob.glob('*.pdf')
# Loop through each PDF file and convert it to a PNG image
@felixbd
felixbd / convert-dicom-images.py
Last active June 22, 2022 09:18
convert dicom images
#!/usr/bin/env python3.9
# -*- coding: utf-8 -*-
"""
Do What the Fuck You Want To Public License - Use at your own risk, no warranty!
"""
import os
import sys
import argparse
@felixbd
felixbd / din-letter-template.tex
Last active January 9, 2024 14:43
Simple letter template. (DIN, LaTeX)
%! Author = felix
%! Date = 12.06.2022
%! License = The Unlicense
\documentclass[fromemail=on, fromphone=on, fromalign=right, DIN]{scrlttr2}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{eurosym}