Skip to content

Instantly share code, notes, and snippets.

@andresgcarmona
Last active October 19, 2022 20:38
Show Gist options
  • Save andresgcarmona/e198b4ae27e454969ee45b611c311c53 to your computer and use it in GitHub Desktop.
Save andresgcarmona/e198b4ae27e454969ee45b611c311c53 to your computer and use it in GitHub Desktop.
Bookmarlets
// find duplicate Id's in DOM
const allElements = document.getElementsByTagName("*");
const allIds = {};
let found = false;
for (let i = 0, n = allElements.length; i < n; ++i) {
const id = allElements[i].id;
if (id) {
if (allIds[id] === undefined) {
allIds[id] = 1;
} else {
found = true;
console.warn('Duplicate ID #' + id);
}
}
}
if (!found) {
console.log('No duplicate IDs found');
}
const css = document.createElement("style");
css.type = "text/css";
css.innerHTML = "img[alt=\"\"],img:not([alt]){ filter:grayscale(100%) }";
document.body.appendChild(css);
var link = document.createElement("link");
link.href = prompt("css url", "");
link.type = "text/css";
link.rel = "stylesheet";
document.getElementsByTagName("head")[0].appendChild(link);
$('.ghx-avatar').each(function() {
const str = $(this)[0].outerHTML;
if (str.indexOf("Assignee:") >= 0) {
$(this).parent().hide();
}
})
// Hide assigned jira tickets
var jq = document.createElement('script');
jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
var md = "[[" + document.URL + "][" + document.title + "]]" ;
prompt("Enter Ctrl+C to copy this org-mode hyperlink. :", md);
var baseUrl = "https://web.archive.org/web/*/"
var urlmod = document.URL
window.location.href = baseUrl + urlmod
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment