Skip to content

Instantly share code, notes, and snippets.

View dale3h's full-sized avatar

Dale Higgs dale3h

View GitHub Profile
@dale3h
dale3h / radarr-bulk.bookmarklet
Last active October 12, 2017 00:28
[Radarr] Bulk Import: Compare and Highlight
javascript:var bulkConfig={path:"/movies/",good:0.95,okay:0.75};jQuery.getScript("http://glench.github.io/fuzzyset.js/lib/fuzzyset.js",function(){var e=jQuery;var g=bulkConfig.path;var b=bulkConfig.good;var f=bulkConfig.okay;var c="rgba(0, 255, 0, 0.2)";var a="rgba(255, 255, 0, 0.2)";var d="rgba(255, 0, 0, 0.2)";e("div#x-movies-bulk table tbody tr").each(function(){var i=e(this).find(".series-title-cell");var m=e(i[0]);var j=e(i[1]);var h=m.find("a").text().trim();var l=j.clone().children().remove().end().text().replace(g,"").trim();cleaner=/[^a-z0-9]/ig;h=h.replace(cleaner,"");l=l.replace(cleaner,"");fz=FuzzySet([h]);score=fz.get(l)[0][0];if(!m.find(".score").length){m.append('<span><br><em>Match: <span class="score"></span>%</em></span>')}m.find(".score").text(Math.round(score*100));var k=true;if(score>=b){e(this).css("background-color",c)}else{if(score>=f){e(this).css("background-color",a)}else{k=false;e(this).css("background-color",d)}}$select=e(this).find(".select-row-cell input");if($select.prop("checke
@dale3h
dale3h / switchmate-notes.md
Created August 24, 2017 05:24
Notes for setting up Switchmate on Linux with python3

Switchmate Notes

node-switchmate

Status: working Adapter: ASUS BLE4.0

$ sudo apt-get install bluetooth bluez libbluetooth-dev libudev-dev
@dale3h
dale3h / gitter-backup.sh
Created May 17, 2017 13:13
Perform local backups of Gitter.im chat rooms.
#!/bin/bash
#
# Perform local backups of Gitter.im chat rooms.
GITTER_ARCHIVE_URL="https://gitter.im/%s/archives/%s"
usage() {
echo "usage: $(basename $0) -f -r <chat-room> [-o <output-dir>] [-s <YYYY/MM/DD>] [-e <YYYY/MM/DD>]" 1>&2
exit 1
}
@dale3h
dale3h / configuration.yaml
Created February 23, 2017 17:54
Default YAML Configuration for Home Assistant 0.38.3
homeassistant:
# Name of the location where Home Assistant is running
name: Home
# Location required to calculate the time the sun rises and sets
latitude: 32.8208
longitude: -97.0107
# Impacts weather/sunrise data (altitude above sea level in meters)
elevation: 196
# metric for Metric, imperial for Imperial
unit_system: imperial
@dale3h
dale3h / udp-forward.js
Last active December 14, 2015 22:37
Simple NodeJS UDP forwarding server
/**
* Simple NodeJS UDP forwarding server
*
* @author dale3h
*
* This script was built to run on a Raspberry Pi that is connected to two networks (wired + wireless).
* By default it listens on port 443, but only serves HTTP (not HTTPS)
*
* @usage
* http://192.168.1.102:443/send-udp?host=192.168.1.113&port=12345&device=wlan0&command=PACKET_CONTENTS