Skip to content

Instantly share code, notes, and snippets.

@jaxrtech
Created January 12, 2018 06:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaxrtech/aab02bea141f46c0993f6b6c056d3ae0 to your computer and use it in GitHub Desktop.
Save jaxrtech/aab02bea141f46c0993f6b6c056d3ae0 to your computer and use it in GitHub Desktop.
Tampermonkey Scripts
// ==UserScript==
// @name Github Code Tab-Size Fix
// @version 0.1
// @description Sets a reasonably tab-size to make code using tabs a bit more readible
// @match https://github.com/*
// @run-at document-start
// ==/UserScript==
function addGlobalStyle(css) {
var head, style;
head = document.getElementsByTagName('head')[0];
if (!head) { return; }
style = document.createElement('style');
style.type = 'text/css';
style.innerHTML = css;
head.appendChild(style);
}
var tabSize = 4;
try {
var fileName = document.getElementsByClassName('final-path')[0].innerHTML;
if (/\.js/.exec(fileName) != null) {
tabSize = 2;
}
} catch (err) { }
addGlobalStyle("* { tab-size: " + tabSize + " }");
// ==UserScript==
// @name IIT Journal Paper Proxy Redirect
// @namespace http://jaxrtech.io/
// @version 0.1
// @description try to take over the world!
// @author You
// @match http://dl.acm.org/citation.cfm?*
// @match http://www.springer.com/us/book/*
// @grant none
// ==/UserScript==
(function() {
'use strict';
let url = new URL(document.location.href);
url.hostname += ".ezproxy.gl.iit.edu";
window.location.replace(url.toString());
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment