Skip to content

Instantly share code, notes, and snippets.

@ihsavru
Last active June 17, 2020 06:07
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 ihsavru/37bd635bba731bbfdc2543928495800d to your computer and use it in GitHub Desktop.
Save ihsavru/37bd635bba731bbfdc2543928495800d to your computer and use it in GitHub Desktop.
Everything is easy - A TamperMonkey userscript which makes all the problems on Leetcode "Easy"
// ==UserScript==
// @name Everything is easy
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Changes tags for every problem to easy!
// @author Urvashi Verma
// @match https://leetcode.com/problems*
// @grant GM_addStyle
// @run-at document-start
// ==/UserScript==
(function() {
'use strict';
var checkForDifficultyEl = setInterval(function(){
var difficultyEl = document.querySelectorAll('span.label.label-danger.round, span.label.label-warning.round');
difficultyEl.forEach(e => {
e.innerHTML = "Easy";
});
}, 1000);
})();
GM_addStyle ( `
div[data-key="description-content"] > div div[diff] {
display: none;
}
div[data-key="description-content"] > div > div:nth-child(1) > div:nth-child(2) {
}
div[data-key="description-content"] > div > div:nth-child(1) > div:nth-child(2):before {
content: 'Easy';
color: green;
display: inline-block;
padding-right: 20px;
font-weight: bold;
}
span.label.label-danger, span.label.label-warning{
color: white;
background-color: #5cb85c;
font-weight: bold;
}
` );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment