Skip to content

Instantly share code, notes, and snippets.

View shoeffner's full-sized avatar

Sebastian Höffner shoeffner

View GitHub Profile
blueprint:
name: Send notification to open a window
description: >-
An automation sends a notification to open a specified window if a) the
humidity of the specified sensor exceeds the humidity threshold and b) the
temperature is not below the temperature threshold.
domain: automation
input:
window:
@shoeffner
shoeffner / pylab_magics.ipynb
Last active May 8, 2023 09:44
This is a gist to demonstrate an issue with animations using IPython's interactive notebook mode. See https://github.com/ipython/ipython/issues/10873 for details.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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:

clean up ipynb's!

This git filter cleans jupyter notebooks. Props @ahoereth .

.gitattributes

*.ipynb filter=clearjupyteroutput

.gitconfig

@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):

🐌  %
🐚  % 
🐑  % 

🐁 %

@shoeffner
shoeffner / dtypefilter.ipynb
Created November 16, 2016 15:15
dtype gotchas with cvtColor und different filter methods.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@shoeffner
shoeffner / keybase.md
Last active August 14, 2016 20:24
My keybase proof.

Keybase proof

I hereby claim:

  • I am shoeffner on github.
  • I am shoeffner (https://keybase.io/shoeffner) on keybase.
  • I have a public key whose fingerprint is 17CC D765 B0C7 C5C1 EE7B 890B FF4B F569 F0FF E9C2

To claim this, I am signing this object:

@shoeffner
shoeffner / verify_pca.py
Created July 7, 2016 21:00
Draw points (potentially with an image as background) and get the principal components drawn nicely. Horrible code though.
"""
Left click adds points.
Right click clears the image.
Use the fancy figure window to store plots.
If 2+ points were added, principal components are drawn at the center of mass.
"""
import matplotlib
matplotlib.use('Qt5Agg')
@shoeffner
shoeffner / !TabletopSimulatorDeckBuilder.ipynb
Last active July 9, 2016 14:03
Creates TabletopSimulator Decks for TCGs.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.