Skip to content

Instantly share code, notes, and snippets.

@soxofaan
soxofaan / openeo-vito-binary-download.ipynb
Created Dec 10, 2019
openEO VITO download binary mask
View openeo-vito-binary-download.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View openeo-scale-range-resample-issue.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@soxofaan
soxofaan / here-jupyter.sh
Last active Mar 23, 2021
here-jupyter: launch Jupyter Notebook in background from current directory using tmux
View here-jupyter.sh
#!/bin/bash
# Build tmux session name from current directory
SESSION_NAME=$(pwd)
# Strip non-alphanumeric characters
SESSION_NAME=${SESSION_NAME//[^a-zA-Z0-9]/}
# Only keep trailing part
SESSION_NAME=Jupyter-${SESSION_NAME: -20}
# Command to run inside tmux session
@soxofaan
soxofaan / .block
Last active Aug 20, 2019
Microphone pitch detection
View .block
license: mit
height: 400
border: no
@soxofaan
soxofaan / .block
Last active Aug 15, 2019
Microphone Spectrum Analyser
View .block
license: mit
height: 500
border: no
@soxofaan
soxofaan / signal_catcher_context.py
Last active Apr 13, 2019
Python (3.6+) context manager that catches signals (e.g. SIGINT, SIGTERM) and exposes that. Allows writing infinite loops that can be exited in a clean way.
View signal_catcher_context.py
import logging
import os
import signal
import time
log = logging.getLogger(__name__)
class SignalCatcher:
@soxofaan
soxofaan / .block
Last active Dec 29, 2018
Circle of Fifths with Diatonic Seventh Chords
View .block
license: mit
height: 800
border: no
@soxofaan
soxofaan / pandas-timeindex-secondary-y-issue.ipynb
Last active Dec 13, 2017
pandas-timeindex-secondary-y-issue.ipynb
View pandas-timeindex-secondary-y-issue.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@soxofaan
soxofaan / zequals.py
Last active Nov 28, 2017
"Zequals" ruthless rounding: just keep one leading digit.
View zequals.py
import math
def zequals(x):
"""
"Zequals" ruthless rounding: just keep one leading digit.
examples:
123 -> 100
4567 -> 5000
-0.0345 -> -0.03
View README.md

Google Apps Script to automatically delete mails with a certain label after a certain time

Usage

  1. Think of a deletion scheme and create GMail labels accordingly (e.g. I use labels 'todelete/after1week', 'todelete/after1month' and 'todelete/after3months' here)
  2. set up filters in GMail to flag desired mails with these labels
  3. create a Google Apps Script with this script (adapt function names, labels and day offsets appropriatedly) and set up triggers as desired

Disclaimer