Skip to content

Instantly share code, notes, and snippets.

@Akdeniz
Last active May 3, 2020 23:49
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Akdeniz/61e5f7ca8423964e3fa96565de9381bf to your computer and use it in GitHub Desktop.
Save Akdeniz/61e5f7ca8423964e3fa96565de9381bf to your computer and use it in GitHub Desktop.
In order to filter locked questions in Leetcode, install Custom Blocker chrome extention and import rule below.
[{"words":[{"word_id":17,"rule_id":1,"word":".*","is_regexp":true,"is_complete_matching":false,"is_case_sensitive":false,"is_include_href":false,"insert_date":1509556290460,"update_date":1509556290460,"delete_date":0}],"search_block_by_css":false,"hide_block_by_css":false,"rule_id":1,"title":"Problems - LeetCode","is_disabled":false,"site_regexp":"https://leetcode.com/problemset/*","example_url":"https://leetcode.com/problemset/all/?difficulty=Medium&status=Todo","site_description":"Problems - LeetCode","specify_url_by_regexp":true,"search_block_xpath":"//TR//DIV//SPAN","search_block_css":"TR I","search_block_description":"","hide_block_xpath":"//TBODY[@class=\"reactable-data\"]//TR","hide_block_css":"","hide_block_description":"","user_identifier":"164e7d1a-d68d-4d38-b51a-394eddaa6adc","global_identifier":"5a544c54-df76-492c-9d58-785d4927ac5f","block_anyway":false,"insert_date":1509551105336,"update_date":1509556446509,"delete_date":0}]
// In order to filter locked questions in Leetcode, install Custom Blocker chrome extention and import rule below.
// https://chrome.google.com/webstore/detail/customblocker/elnfhbjabfcepfnaeoehffgmifcfjlha
// ==UserScript==
// @name leetcode hide locked problems
// @description Hide Locked Problems on Leetcode
// @version 0.1
// @author akdeniz
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js
// @match https://leetcode.com/*
// ==/UserScript==
(function() {
'use strict';
observeDomChange();
})();
function observeDomChange() {
var MutationObserver = window.MutationObserver;
var myObserver = new MutationObserver (remove_locked_questions);
var obsConfig = {
childList: true, attributes: true,
subtree: true, attributeFilter: ['list-group']
};
myObserver.observe (document, obsConfig);
function remove_locked_questions () {
var $locked_question_rows = $("tbody.reactable-data").find("tr").filter(
function(){
return $(this).find('i.fa-lock').length > 0;
});
for (var i = 0; i < $locked_question_rows.length; i++) {
try{
$locked_question_rows[i].remove();
}catch(err)
{
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment