Skip to content

Instantly share code, notes, and snippets.

@v-dimitrov
Created February 4, 2014 23:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save v-dimitrov/8814250 to your computer and use it in GitHub Desktop.
Save v-dimitrov/8814250 to your computer and use it in GitHub Desktop.
Userscript - make specific long files in github online diff view shorter, since you don't need to check them.
// ==UserScript==
// @name GitHub Suppress Diffs
// @version 2013.10.29
// @namespace FET
// @description Suppress style.css
// @include http*://github.com/*
// ==/UserScript==
// Files to suppress:
suppressFiles([
"telerik/css/style.css",
"documentation/styles/css/theme.css"
]);
// Call resize on the specified files:
function suppressFiles(path){
for (var url in path) {
resizeDiff(document.querySelector('.meta[data-path="' + path[url] + '"]').nextElementSibling);
}
}
// Resize the diff area in github:
function resizeDiff(obj) {
obj.style.height = "200px";
obj.style.overflow = "auto";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment