Skip to content

Instantly share code, notes, and snippets.

@Staberinde
Staberinde / mixin_patterns.py
Created October 7, 2021 14:23
Practical example of mixins in python
"""
# Mixin
## Definition
From https://en.wikipedia.org/wiki/Mixin
In object-oriented programming languages, a mixin (or mix-in)[1][2][3][4] is a class that contains methods for use by other classes without having to be the parent class of those other classes. How those other classes gain access to the mixin's methods depends on the language. Mixins are sometimes described as being "included" rather than "inherited".
"""
# Base case
@Staberinde
Staberinde / post-checkout.py
Created September 7, 2018 11:23 — forked from inklesspen/post-checkout.py
Post-checkout hook to detect alembic issues when switching branches.
#!/usr/bin/env python
"""
Provide useful alembic information after switching branches.
"""
import argparse
import subprocess
import os
import os.path
import py.path

Keybase proof

I hereby claim:

  • I am staberinde on github.
  • I am staberinde (https://keybase.io/staberinde) on keybase.
  • I have a public key ASCx_S0l3w3R_RWtNT3OUI8NgR-GnXomEnNG2u-l5w9KFQo

To claim this, I am signing this object: