Skip to content

Instantly share code, notes, and snippets.

View fallaciousreasoning's full-sized avatar

Jay Harris fallaciousreasoning

  • Queenstown, New Zealand
View GitHub Profile
@fallaciousreasoning
fallaciousreasoning / outlook-theme-color.js
Created July 30, 2019 06:25
A ViolentMonkey/TamperMonkey/GreaseMonkey script for keeping add/updating a meta theme-color tag for Outlook.com
// ==UserScript==
// @name Set Outlook Theme Color
// @namespace Violentmonkey Scripts
// @match https://outlook.live.com/mail/*
// @grant none
// ==/UserScript==
function updateThemeColor() {
let themeMeta = document.querySelector("meta[name=theme-color]");
@fallaciousreasoning
fallaciousreasoning / magnet-new-tab.js
Created August 18, 2019 02:14
Opens magnet links in a new tab. This is useful if you have a website registered as a handler for magnet:// links (such as instant.io, or Deluge Web)
// ==UserScript==
// @name Magnet Links in New Tab
// @namespace Violentmonkey Scripts
// @match https://thepiratebay.*/*
// @match *://audiobookbay.*/*
// @grant none
// ==/UserScript==
const poll = (action, regularity) => {
action();
@fallaciousreasoning
fallaciousreasoning / deluge-magnet-protocol-handler.js
Created August 18, 2019 02:17
Adds support for opening magnet:// links in Deluge Web. If you want this to work for you, you'll likely have to configure the @match url to be the url of your Deluge Web, and set `dom.registerProtocolHandler.insecure.enabled` to true in your Firefox about:config, as by default protocol handlers cannot be registered on http sites.
// ==UserScript==
// @name Deluge Protocol Handler
// @namespace Violentmonkey Scripts
// @match http://192.168.86.74:8112/*
// @grant none
// ==/UserScript==
if (navigator.registerProtocolHandler)
navigator.registerProtocolHandler("magnet", "http://192.168.86.74:8112/?magnet=%s", "Deluge");
@fallaciousreasoning
fallaciousreasoning / the-crag-trad-filter.js
Last active August 21, 2019 02:11
A helper script for the crag for showing/hiding trad routes. This adds a button "Show/Hide Trad Routes" to the start of the Routes table.
// ==UserScript==
// @name The Crag, Only Sport
// @description A script for filtering trad climbs on the crag.
// @locale en
// @namespace Violentmonkey Scripts
// @match https://www.thecrag.com/*
// @grant none
// ==/UserScript==
const storeValue = (key, value) => localStorage.setItem(key, value);
const getValue = (key) => {
@fallaciousreasoning
fallaciousreasoning / goodreads-sort-to-read-by-date-added.js
Created November 6, 2019 07:21
By default, Goodreads sorts the to read shelf by least recently added. This reverses that.
// ==UserScript==
// @name Goodreads: Sort To Read by most recently added.
// @namespace Violentmonkey Scripts
// @match https://www.goodreads.com/*
// @downloadURL
// @grant none
// ==/UserScript==
const getLinksToUpdate = () => {
// Get all links to the to-read shelf that don't specify a sort order.
@fallaciousreasoning
fallaciousreasoning / messenger-unread-badges.js
Last active November 18, 2019 23:11
Uses the experimental Badging API to Badge messenger.com when installed as a desktop PWA.
// ==UserScript==
// @name Messenger.com Unread Count
// @namespace Violentmonkey Scripts
// @match https://www.messenger.com/*
// @grant none
// ==/UserScript==
const getUnreadCount = () => {
return document.querySelectorAll('._1ht3').length;
}
@fallaciousreasoning
fallaciousreasoning / outlook-unread-email-badges.js
Last active November 18, 2019 23:12
A ViolentMonkey/TamperMonkey/GreaseMonkey script for setting unread counts on Outlook.com
// ==UserScript==
// @name Outlook Unread Badge
// @namespace Violentmonkey Scripts
// @match https://outlook.live.com/mail/*
// @grant none
// ==/UserScript==
const getUnreadCount = () => {
return document.querySelectorAll(`div[aria-label~='Unread']`).length;
}
@fallaciousreasoning
fallaciousreasoning / github-notification-badges.js
Last active November 18, 2019 23:13
A ViolentMonkey/TamperMonkey/GreaseMonkey script for setting unread notification badges for Github.com
// ==UserScript==
// @name GitHub Notification Badges
// @namespace Violentmonkey Scripts
// @match https://github.com/*
// @grant none
// ==/UserScript==
//
const getNotificationsCount = async () => {
const response = await fetch('https://github.com/notifications');
@fallaciousreasoning
fallaciousreasoning / mailto:outlook.com.js
Last active January 15, 2020 05:34
A ViolentMonkey/GreaseMonkey/TamperMonkey script for opening mailto: links in Outlook.com
// ==UserScript==
// @name Outlook mailto: Handler
// @namespace Violentmonkey Scripts
// @match https://outlook.live.com/*
// @grant none
// @version 0.0.2.20190821021306
// @updateUrl https://gist.githubusercontent.com/fallaciousreasoning/3d0928be6f26778548de2d84778c3bb8/raw/mailto:outlook.com.js
// @description Let's Outlook.com open mailto: links
// ==/UserScript==

Keybase proof

I hereby claim:

  • I am fallaciousreasoning on github.
  • I am dntbrsnbl (https://keybase.io/dntbrsnbl) on keybase.
  • I have a public key ASB8pWtl1gPQdF0krk8VnM8zDpRk233l1XiCNnjRhih-iQo

To claim this, I am signing this object: