Skip to content

Instantly share code, notes, and snippets.

Avatar

René Schimmelpfennig MCeddy

View GitHub Profile
@MCeddy
MCeddy / store.helper.ts
Created Oct 17, 2020
Helper functions to work dictionaries on #angular #ngrx
View store.helper.ts
export interface HasId {
id: string;
}
export interface HasOrderIndex {
orderIndex: number;
}
export interface Dictionary<T extends HasId> {
[id: string]: T;
}
@MCeddy
MCeddy / imap_cleanup.py
Created Jul 26, 2020
I redirect an copy of my mails to my Gmail account. But the original message always remains in my provider's IMAP mailbox. To save disk space this script helps me to delete old emails automatically. This script was inspired by https://gist.github.com/Rathgore/2597705
View imap_cleanup.py
from imapclient import IMAPClient, DELETED
import datetime
SERVER = 'imap.yourdomain.com'
USERNAME = 'mail'
PASSWORD = '1234567890'
FOLDER = 'INBOX'
MAX_DAYS = 90 # emails older than was deleted
@MCeddy
MCeddy / flow.json
Created Nov 28, 2019
node-red flow - presence detection
View flow.json
[
{
"id": "6a823385.834cbc",
"type": "tab",
"label": "AWTRIX",
"disabled": false,
"info": ""
},
{
"id": "91c2dade.0c6518",
@MCeddy
MCeddy / shutdown.py
Last active Sep 1, 2017
raspberry pi 3 shudown button
View shutdown.py
import RPi.GPIO as GPIO
import os
BUTTON_PIN = 14
GPIO.setmode(GPIO.BCM)
GPIO.setup(BUTTON_PIN, GPIO.IN)
try:
channel = GPIO.wait_for_edge(BUTTON_PIN, GPIO.RISING)
You can’t perform that action at this time.