Skip to content

Instantly share code, notes, and snippets.

View fish2000's full-sized avatar
👉
My Python work is on the Mars helicopter, and ubiquitous on earth, and more!!!!

Alexander Böhn fish2000

👉
My Python work is on the Mars helicopter, and ubiquitous on earth, and more!!!!
View GitHub Profile
@zachlewis
zachlewis / cicp-encodings-v1.3.0.ocio
Created May 18, 2026 14:42
Proof-of-concept OCIO config representing real-world CICP encodings
ocio_profile_version: 2.5
strictparsing: true
name: cicp-encodings-v1.3.0
description: |
An OCIO config for working with CICP metadata
This config contains RGB color spaces that correspond to various encodings defined in
the CICP / H.273 specifications.
Includes aliases included with `png_cicp_editor` utility. See https://svgees.us/blog/cICP.html#fn26
@zachlewis
zachlewis / NumericLookup.py
Last active October 3, 2026 00:09
NumericLookup
import numpy as np
class NumericLookup(dict):
"""
Extends *dict* type to provide a lookup by value(s), including numpy arrays.
Methods
-------
keys_from_value
first_key_from_value
@zachlewis
zachlewis / build_test_ocio2_config.py
Last active October 3, 2026 00:10
OCIO 2.0 test config
import PyOpenColorIO as ocio
import numpy as np
import colour as colour
from six import string_types
__version__ = "2020.11.08.0"
OUTPUT = "/tmp/test_config.ocio2"
@dhilst
dhilst / delegate.py
Last active January 24, 2025 19:57
Delegate methods in python
def delegate(to, *methods):
'''
Class decorator to delegate methods to another objects.
>>> @delegate('v', 'upper')
... @delegate('v', 'lower')
... @delegate('v', 'wrong_method')
... @delegate('not_an_attribute', 'wrong_attribute')
... class Foo:
... def __init__(self, v):
... self.v = v
@fish2000
fish2000 / keyvalue.py
Last active May 10, 2019 01:29
Generic Python REPL configuration NOW WITH ANSI-COLOR FIGLET BANNERS DOGG
#!/usr/bin/env python
# -*- encoding: utf-8 -*-
import plistlib
import zict
import os
import appdirs
from replutilities import attr, isstring, isbytes

DevOps README.md

The Phoenix Project

  • Novel; Not your typical technical book
  • Transformation of Broken Organization towards DevOps Culture
  • Quintessential beginning of a DevOps journey
  • Pros: Easy to digest, can suggest to executives
  • Cons: The implementation details are fuzzy
  • Quip: We all know Brent. Help Brent not be Brent.
@elidchan
elidchan / verbiage.py
Created January 19, 2019 17:30
Utilities for indefinite article and plurality
import ast
import contextlib
import json
import os
import string
from collections import OrderedDict
from enum import Enum
from numbers import Number
from string import Template
@DangerOnTheRanger
DangerOnTheRanger / importhooks.py
Last active August 19, 2022 02:54
Example showing how to use import hooks in Python 3 - original article: https://dev.to/dangerontheranger/dependency-injection-with-import-hooks-in-python-3-5hap
import importlib.abc
import importlib.machinery
import sys
import types
class DependencyInjectorFinder(importlib.abc.MetaPathFinder):
def __init__(self, loader):
self._loader = loader
def find_spec(self, fullname, path, target=None):
@fish2000
fish2000 / pycheckmate.py
Last active December 5, 2018 17:53
Overhaul of PyCheckMate.py for Python 3.7 circa late 2018
#!/usr/bin/env python
# encoding: utf-8
#
# PyCheckMate, a PyChecker output beautifier for TextMate.
# Copyright (c) Jay Soffian, 2005. <jay at soffian dot org>
# Inspired by Domenico Carbotta's PyMate.
# Extensively overhauled for version 2.0 by Alexander Böhn.
#
# License: Artistic.
#
@fish2000
fish2000 / multiple_dispatch.py
Last active November 20, 2018 20:25 — forked from wolfv/multiple_dispatch.py
A Taste Of Julia / C++ in Python – simple Python multiple dispatch from type hints
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# multiple_dispatch.py
#
# My version:
# https://gist.github.com/fish2000/1af4b852d20b7568a9b9c90fe2346b6d
#
# Forked from the originall by @wolfv:
# https://gist.github.com/wolfv/73f56e4a9cac84eea6a796fde3213456