Skip to content

Instantly share code, notes, and snippets.

@tophers
tophers / check-mail.py
Created October 3, 2018 05:06
Home Assistant USPS sensor workaround
#!/usr/bin/env python
import email, email.header, datetime, imaplib, re, sys
host = 'imap.gmail.com'
username = ''
password = ''
folder = 'INBOX'
def login(host, username, password):
@tophers
tophers / app.py
Created November 2, 2015 20:40 — forked from boralyl/app.py
from datetime import datetime, timedelta
import json
import time
import ephem
from flask import Flask
import requests
from werkzeug.contrib.fixers import ProxyFix
from constants import MAIN_LIGHTS_GROUP_ID
@tophers
tophers / somacli.sh
Created December 16, 2013 07:20 — forked from bcicen/somacli.sh
#!/bin/bash
baseurl="http://somafm.com"
tmpdir="/tmp/"
boldtext=`tput bold`
normaltext=`tput sgr0`
WGET="/usr/bin/wget"
MPLAYER="/usr/bin/mplayer"
stationnames=("Christmas Rocks!" "Christmas Lounge" "Xmas in Frisko (holiday)" "Groove Salad (ambient/electronica)" "Lush (electronica)" "Earwaves (experimental)" "Deep Space One (ambient)" "Drone Zone (ambient)" "PopTron (alternative)" "DEF CON Radio (specials)" "Dub Step Beyond (electronica)" "Space Station Soma (electronica)" "Mission Control (ambient/electronica)" "Indie Pop Rocks! (alternative)" "Folk Forward (folk/alternative)" "BAGeL Radio (alternative)" "Digitalis (electronica/alternative)" "Sonic Universe (jazz)" "Secret Agent (lounge)" "Suburbs of Goa (world)" "Boot Liquor (americana)" "Illinois Street Lounge (lounge)" "The Trip (electronica)" "cliqhop idm (electronica)" "Iceland Airwaves (alternative)" "Covers (eclectic)" "Underground 80s (alternative/electronica)" "Beat Blender (electronica)" "Doomed (ambient/industrial)" "Black Rock FM (eclectic)" "SF