Skip to content

Instantly share code, notes, and snippets.

View stephen2m's full-sized avatar

Stephen Mutua stephen2m

View GitHub Profile
@stephen2m
stephen2m / audit_mixin.py
Created March 14, 2020 07:42 — forked from ngse/audit_mixin.py
Rough attempt at implementing an audit log against Flask/Flask Login/SQLAlchemy models
# Requires use of Flask Login for the user tracking
# Implement by using AuditableMixin in your model class declarations
# e.g. class ImportantThing(AuditableMixin, Base):
import json
from flask_login import current_user
from sqlalchemy import event, inspect
from sqlalchemy.orm import class_mapper
from sqlalchemy.orm.attributes import get_history
@stephen2m
stephen2m / git-pull-recursive.sh
Created March 29, 2021 20:03 — forked from devp619/git-pull-recursive.sh
Lots of repos? Try "git-pull-recursive" to run "git pull" on all subfolders with a .git folder inside.Thanks to http://snipplr.com/view/62314/perform-git-pull-on-subdirectory-recursive/
# For use in a shell:
# Download this file to /usr/local/bin/git-pull-recursive, then chmod 755 it to install git-pull-recursive
find . -type d -name .git -exec sh -c "cd \"{}\"/../ && pwd && git pull" \;