Skip to content

Instantly share code, notes, and snippets.

View hermandr's full-sized avatar

Herman Tan hermandr

View GitHub Profile
@matteoferla
matteoferla / docstrings2md.py
Last active April 3, 2024 12:26
Python codeblock to generate a file called 'autogenerated_docs.md' which has all the docstrings converted to markdown via Sphinx 🐍📝🦁
# for details see https://stackoverflow.com/questions/36237477/python-docstrings-to-github-readme-md
# further details in https://blog.matteoferla.com/2019/11/convert-python-docstrings-to-github.html
import re
import shutil
import os
import subprocess
# ## Settings
repo_path = '/Users/👾👾👾/👾👾👾'
@cszang
cszang / spawn_progressbar.R
Last active February 14, 2023 13:31
A progressbar that fits into a dplyr::mutate -> purrr::map* pipeline
library(rlang)
library(tidyr)
library(dplyr)
library(purrr)
spawn_progressbar <- function(x, .name = .pb, .times = 1) {
.name <- substitute(.name)
n <- nrow(x) * .times
eval(substitute(.name <<- dplyr::progress_estimated(n)))
x