Skip to content

Instantly share code, notes, and snippets.

@BrockA
BrockA / Add_kbd_shortcut.user.js
Last active February 12, 2017 22:00
This is a userscript that adds shortcuts for adding <kbd> tags to posts. Designed for Stack Exchange sites.
// ==UserScript==
// @name OBSOLETE: StackExchange, Add kbd shortcut
// @description Adds a button and a keyboard shortcut (Alt-K) to add <kbd> tags.
// @version 1.3
// @match *://*.askubuntu.com/*
// @match *://*.onstartups.com/*
// @match *://*.serverfault.com/*
// @match *://*.stackapps.com/*
// @match *://*.stackexchange.com/*
// @match *://*.stackoverflow.com/*
@BrockA
BrockA / checkForBadJavascripts.js
Created May 6, 2012 06:11
This is a utility function, meant to be used inside a Greasemonkey script that has the "@run-at document-start" directive set. It Checks for and deletes or replaces specific <script> tags.
/*--- checkForBadJavascripts()
This is a utility function, meant to be used inside a Greasemonkey script that
has the "@run-at document-start" directive set.
It Checks for and deletes or replaces specific <script> tags.
*/
function checkForBadJavascripts (controlArray) {
/*--- Note that this is a self-initializing function. The controlArray
parameter is only active for the FIRST call. After that, it is an
event listener.
@BrockA
BrockA / checkForBadJavascripts_Demo.user.js
Created May 6, 2012 06:50
This demonstrates the checkForBadJavascripts function in a complete Greasemonkey script and against a target page (http://jsbin.com/ogudon).
// ==UserScript==
// @name _Replace evil Javascript
// @include http://jsbin.com/ogudon*
// @run-at document-start
// ==/UserScript==
/****** New "init" function that we will use
instead of the old, bad "init" function.
*/
function init () {
@BrockA
BrockA / waitForKeyElements.js
Created May 7, 2012 04:21
A utility function, for Greasemonkey scripts, that detects and handles AJAXed content.
/*--- waitForKeyElements(): A utility function, for Greasemonkey scripts,
that detects and handles AJAXed content.
Usage example:
waitForKeyElements (
"div.comments"
, commentCallbackFunction
);
@BrockA
BrockA / Add_Timeline_Button_to_Stack_Exchange_questions.user.js
Last active August 28, 2019 14:55
Adds a link to the timeline view to questions. This is a userscript for Stack Exchange sites.
// ==UserScript==
// @name Stack Exchange: Add Timeline and Revisions links to posts
// @description Adds links to posts to always show history and links to questions to show the Timeline".
// @namespace StackExchange
// @match *://*.askubuntu.com/questions/*
// @match *://*.mathoverflow.net/questions/*
// @match *://*.serverfault.com/questions/*
// @match *://*.stackapps.com/questions/*
// @match *://*.stackexchange.com/questions/*
// @match *://*.stackoverflow.com/questions/*
@BrockA
BrockA / hatoverflow.user.js
Last active December 14, 2015 04:51
Stack Exchange, Winterbash, Hat Overflow
// ==UserScript==
// @name Stack Exchange, Winterbash, Hat Overflow
// @description Adds how many Winterbash hats each user has, into the "signature blocks" of posts.
// @match *://*.askubuntu.com/*
// @match *://*.mathoverflow.net/*
// @match *://*.onstartups.com/*
// @match *://*.serverfault.com/*
// @match *://*.stackapps.com/*
// @match *://*.stackexchange.com/*
// @match *://*.stackoverflow.com/*