Skip to content

Instantly share code, notes, and snippets.

View shoeffner's full-sized avatar

Sebastian Höffner shoeffner

View GitHub Profile
@shoeffner
shoeffner / flatten.py
Created July 3, 2017 08:56 — forked from ahoereth/flatten.py
Python flatten
def flatten(x, depth=-1):
"""Flattens a list of lists into a single list."""
if depth == 0:
return x
if isinstance(x, list):
result = []
for el in x:
if hasattr(el, '__iter__') and not isinstance(el, str):
result.extend(flatten(el, depth - 1))
else:
@shoeffner
shoeffner / README.md
Last active February 28, 2017 15:29 — forked from s3ththompson/README.md
Mini (Minimal) Zoo

Mini Minimal Zoo

ZSH theme, further simplied from Minimal Zoo by s3ththompson.

Shows animal emoji followed by a % sign, denoting the last return value (red for non-zero, green for zero):

🐌  %
🐚  % 
🐑  % 

🐁 %