This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(async () => { | |
const selectedText = document.title + '\n...\n"' + getSelection().toString() + '"\n...'; | |
const newUrl = new URL(location); | |
newUrl.hash = `:~:text=${encodeURIComponent(selectedText)}`; | |
const tweetText = encodeURIComponent(selectedText); | |
const tweetUrl = encodeURIComponent(newUrl); | |
const twitterUrl = `https://twitter.com/intent/tweet?text=${tweetText}&url=${tweetUrl}`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
var datePattern = /(\d{2})\/(\d{2})\/(\d{4})/; | |
var today = new Date(); | |
var dateNodes = []; | |
function isToday(date) { | |
var now = new Date(); | |
return date.getDate() === now.getDate() && | |
date.getMonth() === now.getMonth() && | |
date.getFullYear() === now.getFullYear(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript: (function () { | |
var pattern = /(?<=\s|^)(?<gSR>\d{2})([\.\/\s-])?(?<gAG>\d{1,4})([\.\/\s-])?(?<gOP>\d{3})([\.\/\s-])?(?<gCONTRATO>\d{1,7})([\.\/\s-])?(?<gDV>\d{2})(?=\s|$)/g; | |
var textNodes = []; | |
function recurse(node) { | |
if (node.nodeType === Node.TEXT_NODE) { | |
textNodes.push(node); | |
} else { | |
for (var i = 0; i < node.childNodes.length; i++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript: (function () { | |
let vCounter = 0; | |
let objAnchors = {}; | |
let popup; | |
let popupStyle = `<style> | |
#id_popup:hover { | |
border: 2px solid red; | |
} | |
#id_popup { | |
background-color: yellow !important; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript: (function () { | |
if (!localStorage.getItem("position")) { | |
localStorage.setItem("position", document.documentElement.scrollTop); | |
target = prompt('Saved positon at: ' + localStorage.getItem("position") + '\nDefine a tag: ', '#yourTagName'); | |
} else { | |
scrollTo(0, localStorage.getItem("position")); | |
alert('Go to load "' + target + '" at scroll position: ' + localStorage.getItem("position")); | |
localStorage.removeItem("position"); | |
} | |
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript : void(function () { | |
const parsedUrl = new URL(window.location.href); | |
const gistMarkletID = parsedUrl.pathname.split('/')[2]; | |
window.alert('GistMarklet ID capturated : ' + gistMarkletID); | |
const directUrl = `http://dschep.github.io/GistMarklets/#${gistMarkletID}`; | |
window.open(directUrl, "_blank"); | |
})(); | |
// Create GistMarklet direct link to bookmarklet | |
// How to use? In gists pages, launch the bookmarklet from the bookmarks bar and wait for the redirection of a new window with the bookmarklet link mounted! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript : void(function () { | |
if ((window.innerWidth + window.scrollX) >= document.body.scrollWidth) { | |
window.scroll(0, 0); | |
} else { | |
window.scrollTo(document.documentElement.scrollWidth, 0); | |
} | |
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript: void (function () { | |
if ((window.innerHeight + window.scrollY) >= document.body.scrollHeight) { | |
window.scroll(0, 0); | |
} else { | |
window.scrollTo(0, document.body.scrollHeight); | |
} | |
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript : (function () { | |
if (!document.getElementById("redLine")) { | |
h = document.createElement("div"); | |
h.setAttribute("id", "redLine"); | |
h.setAttribute("style", "width:100%;height:3px;background-color:red;font-size:inherit;line-height:inherit;position:absolute;left:0px;top:0px;z-index:999;opacity:1;"); | |
document.getElementsByTagName("body")[0].appendChild(h); | |
window.onmousemove = function (e) { | |
var h = document.getElementById("redLine"); | |
h.style.top = (e.pageY + 15) + "px"; | |
h.setAttribute("class", e.pageY); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
javascript: (function (window, document, undefined) { | |
try { | |
var selectedText = document.getSelection().toString(); | |
if (selectedText === "") { | |
selectedText = window.location.href; | |
} | |
if (selectedText !== "") { | |
var clipB = prompt("Content to qrCode renderize", selectedText); | |
if (clipB !== null) { | |
void navigator.clipboard.writeText(clipB); |
NewerOlder