Skip to content

Instantly share code, notes, and snippets.

View bachya's full-sized avatar

Aaron Bach bachya

View GitHub Profile
- platform: denvertrash
recollect_place_id: xxxxxxxxxxx
monitored_conditions:
- extra_trash
- recycling
- trash
@bachya
bachya / log.txt
Created October 19, 2017 15:58
Vacuum Log
2017-10-19 09:52:42 INFO (MainThread) [homeassistant.loader] Loaded history from homeassistant.components.history
2017-10-19 09:52:42 INFO (MainThread) [homeassistant.loader] Loaded recorder from homeassistant.components.recorder
2017-10-19 09:52:42 INFO (MainThread) [homeassistant.loader] Loaded http from homeassistant.components.http
2017-10-19 09:52:42 INFO (MainThread) [homeassistant.loader] Loaded frontend from homeassistant.components.frontend
2017-10-19 09:52:42 INFO (MainThread) [homeassistant.loader] Loaded api from homeassistant.components.api
2017-10-19 09:52:42 INFO (MainThread) [homeassistant.loader] Loaded websocket_api from homeassistant.components.websocket_api
2017-10-19 09:52:42 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_registered[L]: domain=logger, service=set_level>
2017-10-19 09:52:42 INFO (MainThread) [homeassistant.setup] Setup of domain logger took 0.4 seconds.
2017-10-19 09:52:42 INFO (MainThread) [homeassistant.core] Bus:Handling <Event component_loaded[L]: c
@bachya
bachya / in-bed.yaml
Created October 15, 2017 16:28
A HomeAssistant Bayesian sensor for whether we’re in bed
binary_sensor:
- platform: 'bayesian'
name: In Bed
prior: 0.29
probability_threshold: 0.95
observations:
- entity_id: 'input_boolean.in_blackout'
prob_given_true: 0.9
platform: 'state'
to_state: 'on'
"""Provides data for trash/recycling/etc. pickups."""
from logging import getLogger
from datetime import timedelta
from math import ceil
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
import homeassistant.util.dt as dt
from homeassistant.components.sensor import PLATFORM_SCHEMA
"""
File: denvertrash.py
Author: Aaron Bach
Email: [email protected]
"""
import asyncio
import datetime
import logging
"""
File: denvertrash.py
Author: Aaron Bach
Email: [email protected]
"""
import datetime
import logging
import os
@bachya
bachya / Hazel-based PDF Scraper
Last active August 5, 2018 01:46
A method to scrape PDFs for certain text (via Hazel) and save the results to a text file
Aaron was here!
Aaron says hi!
@bachya
bachya / Spillo Bookmarks to CSV.scpt
Created September 9, 2014 21:09
Exports bookmarks from Spillo into CSV format
-- Build a CSV string of all the bookmark data:
set bookmarkCsv to {"url,title,desc,date,unread,private,tagged"}
tell application "Spillo"
repeat with b in bookmarks
set theUrl to url of b
set theTitle to title of b
set theDesc to desc of b
set theDate to date of b
set unreadStatus to unread of b
set privateStatus to private of b
@bachya
bachya / Better Gist Shortcode.sh
Last active August 29, 2015 14:06
aText snippet that takes a gist ID or URL from the clipboard and creates a Wordpress shortcode/link pair
GIST_ID=$(echo "【clipboard】" | sed -Ee 's/https?:\/\/gist\.github\.com\/[^\/]+\///')
echo "[gist ${GIST_ID} /]" \
"<div class=\"no_js\">" \
"<a name=\"${GIST_ID}\"></a>" \
"<a href=\"#${GIST_ID}\">Click here to see the Gist.</a>" \
"</div>"
@bachya
bachya / Static Markdown Links from Firefox.scpt
Last active August 29, 2015 14:06
For use in TextExpander or aText. Grabs the current tab in Firefox and returns a Markdown link with the correct URL and a prompt to enter the link text.