Skip to content

Instantly share code, notes, and snippets.

  • Install gatt and test it works with sudo gattctl --discover: https://github.com/getsenic/gatt-python
  • Get the mac of your Turn Touch using gattctl and update monitor.py appropriately (remember to unpair your tt from everything else first!)
  • simply run sudo python3 monitor.py. Press some buttons and if everything is set up correctly, you will see it respond!
@fredley
fredley / day-15.go
Created December 19, 2018 11:27
AoC Day 15
package main
import (
"fmt"
"github.com/beefsack/go-astar"
"io/ioutil"
"math"
"sort"
"strings"
)
var decode = function(save){
return LZString.decompressFromBase64(save.split("|")[1].substring(16));
}
var encode = function(json){
return btoa("1.0.19") + "|" + btoa("SAVE HAX0R3D") + LZString.compressToBase64(json);
}
// ==UserScript==
// @name ChatSEy
// @description Nicer Mobile Chat
// @version 1.0
// @include http://chat.meta.stackoverflow.com/rooms/*
// @include http://chat.stackexchange.com/rooms/*
// @include http://chat.stackoverflow.com/rooms/*
// @include http://chat.askubuntu.com/rooms/*
// @run-at document-end
// ==/UserScript==
@fredley
fredley / gpx2svg.py
Last active November 21, 2022 13:50
import gpxpy
from haversine import haversine
from pyproj import Transformer
import sys
from svgpathtools import Path, Line
import svgwrite
fnames = sys.argv[1:]
if not fnames: