Skip to content

Instantly share code, notes, and snippets.

View amnuts's full-sized avatar

Andrew Collington amnuts

View GitHub Profile
@amnuts
amnuts / Dockerfile
Created October 3, 2023 10:59
Run PHPCompatibility/PHPCompatibility on a directory using docker containers
FROM php:8.2-cli
COPY --from=composer:2 /usr/bin/composer /usr/local/bin/composer
ENV COMPOSER_ALLOW_SUPERUSER 1
RUN apt-get update && apt-get install -y --no-install-recommends git curl zip unzip \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /var/cache/apk/* /usr/share/man /tmp/*
@amnuts
amnuts / output_table.py
Last active May 8, 2025 09:05
Print out a Rich (python library) Table as either a table, a json structure, or a csv file - handy for piping into jq or saving to a file for processing later, or simply just displaying to screen.
import dateutil.parser
from rich.table import Table
def table_to_dict(rich_table: Table, transposed: bool = True) -> dict|list:
"""
Convert a rich.Table into dict
Args:
rich_table (Table): A rich Table that should be populated by the DataFrame values