Skip to content

Instantly share code, notes, and snippets.

@TimSoethout
TimSoethout / configuration.yaml
Last active September 11, 2019 11:20
Crude sensor for home assistant that scrapes from GoodWe SEMS portal. Put `sems.py` in `custom_components/sensor` in your home assistant config dir. And update configuration.
sensor:
- platform: sems
username: 'XXXX'
password: 'XXXX'
@TimSoethout
TimSoethout / sems.py
Created December 31, 2018 19:16
Put in `custom_components/sensor` in your home assistant config dir.
#!/usr/bin/env python3
import voluptuous as vol
import json
import logging
# import urllib.request
import requests
from bs4 import BeautifulSoup
from homeassistant.const import TEMP_CELSIUS
#!/usr/bin/env python3
import sys
import datetime
import time as t
import os
import subprocess
import json
import re
import base64
import ssl
@TimSoethout
TimSoethout / Capture REPLesent slides.scpt
Created June 20, 2016 08:58
Apple script to capture all REPLesent slides and their REPL output
tell application "iTerm"
activate
delay 1
do shell script "screencapture /tmp/slide0.png"
tell current session of first window
repeat with n from 1 to 60
write text "n"
delay 0.5
do shell script "screencapture /tmp/slide" & n & ".png"
write text "r"
package nl.timmybankers.implicits
object ScopingTest extends App {
def resolve(implicit caseClass : CaseClass) = println(caseClass)
def implicitlyCaseClass() = {
resolve
}
@TimSoethout
TimSoethout / sync.sh
Last active February 21, 2016 18:10 — forked from wernerb/sync.sh
Sync folder with Google Drive. Recursively downloads with wget and Google Drive public links. Used to sync ebooks to my eReaders (Kobo). Be warned that public links are dangerous as they could allow someone to download your files. Be sure to use this only in secure environments. This has been tested to be used in POSIX shells as well as in bash.
#!/bin/sh
set -x
#input sharelink here. Example: https://drive.google.com/folderview?id=0B1g-MbiD2F6vdtOT92b3MoerO&usp=sharing
# SHARELINK="https://drive.google.com/folderview?id=idU&usp=sharing"
SHARELINK="https://drive.google.com/folderview?id=0B8HjeRxyzNm7RjZIdDFVWHkxeXM&usp=sharing"
DESTINATION="/mnt/onboard/gdrive"
# Change following to false when you don't want to delete files when they are missing from google drive. This can
@TimSoethout
TimSoethout / EvernoteMoveToCompleted.scpt
Created July 26, 2015 14:52
Move Evernote Selection to Completed Notebook
tell application "Evernote"
set noteList to selection
repeat with oneNote in noteList
move oneNote to notebook "Completed"
end repeat
end tell