Skip to content

Instantly share code, notes, and snippets.

Tom White fredley

Block or report user

Report or block fredley

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View day-15.go
package main
import (
"fmt"
"github.com/beefsack/go-astar"
"io/ioutil"
"math"
"sort"
"strings"
)
View Readme.md
  • 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 / recipes.py
Created May 17, 2016
BBC recipe archive tool
View recipes.py
"""
Save a copy of all BBC recipes as JSON files.
Instructions:
Run this file with Python 3 in an environment with BeautifulSoup4 and requests:
virtualenv -p python3 env
source env/bin/activate
pip install requests beautifulsoup4
@fredley
fredley / topic.user.js
Last active Aug 29, 2015
Chat Topic Change Diffs
View topic.user.js
// ==UserScript==
// @name Room Topic Diff
// @description Whenever the room topic is changed, displays what it was before
// @author fredley
// @version 1.0.0
// @include *://chat.meta.stackoverflow.com/rooms/*
// @include *://chat.meta.stackexchange.com/rooms/*
// @include *://chat.stackexchange.com/rooms/*
// @include *://chat.stackoverflow.com/rooms/*
// @include *://chat.askubuntu.com/rooms/*
@fredley
fredley / upload.user.js
Created Mar 4, 2015
Drag+Drop image uploader for SE chat
View upload.user.js
// ==UserScript==
// @name Chat Image Upload
// @description Drag and Drop upload images
// @author fredley
// @version 1.0.0
// @include *://chat.meta.stackoverflow.com/rooms/*
// @include *://chat.meta.stackexchange.com/rooms/*
// @include *://chat.stackexchange.com/rooms/*
// @include *://chat.stackoverflow.com/rooms/*
// @include *://chat.askubuntu.com/rooms/*
View friday.user.js
// ==UserScript==
// @name It's Never Friday
// @description Detects links to Rebecca Black's Friday
// @version 1.0.0
// @include *://chat.meta.stackoverflow.com/rooms/*
// @include *://chat.meta.stackexchange.com/rooms/*
// @include *://chat.stackexchange.com/rooms/*
// @include *://chat.stackoverflow.com/rooms/*
// @include *://chat.askubuntu.com/rooms/*
// @run-at document-end
View friday.user.js
// ==UserScript==
// @name It's Never Friday
// @description Detects links to Rebecca Black's Friday
// @version 1.0.0
// @include *://chat.meta.stackoverflow.com/rooms/*
// @include *://chat.meta.stackexchange.com/rooms/*
// @include *://chat.stackexchange.com/rooms/*
// @include *://chat.stackoverflow.com/rooms/*
// @include *://chat.askubuntu.com/rooms/*
// @run-at document-end
View Swarm Sim Save Hack
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);
}
View gist:d63b2b9bb195d2b5494a
// ==UserScript==
// @name Badge Popups
// @description YAY BADGES
// @version 1.0
// @include *//meta.stackexchange.com/users/*
// @run-at document-end
// ==/UserScript==
var init = function($){
if($('.people-helped').length == 0) return;
@fredley
fredley / SECommentSaver.user.js
Last active Aug 29, 2015
SE Comment Saver - Save Comments on SE
View SECommentSaver.user.js
// ==UserScript==
// @name SE Comment Saver
// @description Save SE
// @version 1.0
// @include http://meta.stackoverflow.com/*
// @include http://*.stackexchange.com/*
// @include http://serverfault.com/*
// @include http://stackoverflow.com/*
// @include http://askubuntu.com/*
// @include http://stackapps.com/*
You can’t perform that action at this time.