Skip to content

Instantly share code, notes, and snippets.

View alexrudy's full-sized avatar

Alex Rudy alexrudy

View GitHub Profile
@alexrudy
alexrudy / docker-postgres
Created December 31, 2017 03:02
Spin up Postgres in a docker container.
#!/usr/bin/env sh
docker run --rm --name local-postgres -e POSTGRES_PASSWORD=$(op get item "local postgres" | jq -r '.details.password') -d -p 5432:5432 -v "$HOME/Documents/postgres/data:/var/lib/postgresql/data" postgres
#!/usr/bin/env sh
# Check missing references extension for proper functioning.
set +ex +o pipefail
DOCS=$(dirname $(dirname $0))
# Test first by writing the missing references file
git checkout $DOCS/conf.py
git checkout lib
"""
PPA - Progress Parallel Apply
A quick tool for parallel apply in python using multiprocessing.
"""
import functools
import multiprocessing as mp
from typing import Dict, Iterable, NamedTuple, Optional, Tuple, Union
@alexrudy
alexrudy / parallel-demo.py
Created June 18, 2022 00:45
Parallelism Demo
"""
Python parallelism demo
Run this file with `python parallel-demo.py` to see how different
parallelism strategies fare with different kinds of parallism.
This requires aiohttp (pip install aiohttp) and requests (pip install requests)
Two environment variables control behavior: