Skip to content

Instantly share code, notes, and snippets.

@tobybot
tobybot / ssb-interop.js
Created August 21, 2018 22:35
Slack Nightmode
/**
* The preload script needs to stay in regular ole JavaScript, because it is
* the point of entry for electron-compile.
*/
const allowedChildWindowEventMethod = [
'windowWithTokenBeganLoading',
'windowWithTokenFinishedLoading',
'windowWithTokenCrashed',
'windowWithTokenDidChangeGeometry',
@tobybot
tobybot / supper.js
Created February 28, 2020 19:42
Automatically superscript special marks
// superscript all reg, copy, and dagger symbols and add "regmark" class
jQuery(document).ready(function ($) {
// Find symbols & replace if they aren't inside a sup tag or a .nosup classed element
$('body :not(script,sup,.nosup)').contents().filter(function () {
return this.nodeType === 3;
}).replaceWith(function () {
return this.nodeValue.replace(/([®©†™])/gi, '<sup class="regmark">$&</sup>');
});
@tobybot
tobybot / trello-actiity-filter-gist.js
Created November 14, 2023 16:04
Trello activity log filter - remove duplicate entries from the activity log caused by mirrored cards (via placker or otherwise) on other boards
/*
* This finds every element with class .phenom as a first-level child of .list-actions,
* then finds ".phenom-meta.quiet" within that, which contains the name of the board.
* If the given board name is not found, then remove this action entry.
* I just run this in the browser console to filter on the fly when needed. Throwing
* it in GitHub Gist in case I lose it locally.
*/
var elements = document.querySelectorAll('.list-actions > .phenom');
for (var i = 0; i < elements.length; i++) {
var element = elements[i];