Skip to content

Instantly share code, notes, and snippets.

@je55ek
je55ek / immutable_json.py
Created January 26, 2018 04:38
Function to create an immutable data structure and its associated marshmallow schema in one fell swoop
from collections import namedtuple
from marshmallow import Schema
from marshmallow.decorators import post_load
def class_and_schema(class_name, fields):
"""Create a class and its marshmallow schema.
Example::
@je55ek
je55ek / .bash_jesse
Created November 15, 2018 03:17
Parts of my .bashrc common across all systems
# Use vim keybindings and vim as default editor
set -o vi
export EDITOR=vim
# Nice terminal with colors
export PS1="\e[0;34m\w\$ \e[m"
alias ls='ls -G'
export LS_COLORS='di=92:fi=0:ln=31:pi=5:so=5:bd=5:cd=5:or=31:mi=0:ex=35:*.rpm=90'
# Change directory and then list directory contents