Skip to content

Instantly share code, notes, and snippets.

@Nemo157
Last active August 28, 2023 18:55
Show Gist options
  • Save Nemo157/a4df65856b79d50f184974a475c7ce98 to your computer and use it in GitHub Desktop.
Save Nemo157/a4df65856b79d50f184974a475c7ce98 to your computer and use it in GitHub Desktop.
// ==UserScript==
// @name Code 55% faster with GitHub Copilot!
// @description Code 55% faster with GitHub Copilot!
// @version 55.6
// @downloadURL https://gist.github.com/Nemo157/a4df65856b79d50f184974a475c7ce98/raw/Code%252055%2525%2520faster%2520with%2520GitHub%2520Copilot!.user.js
// @updateURL https://gist.github.com/Nemo157/a4df65856b79d50f184974a475c7ce98/raw/Code%252055%2525%2520faster%2520with%2520GitHub%2520Copilot!.user.js
// @match https://github.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=github.com
// @grant none
// ==/UserScript==
(function() {
'use strict'
const s = "Code 55% faster with GitHub Copilot!"
const replace = () => {
const els = []
for (const el of document.all) {
if ('childElementCount' in el && el.childElementCount == 0 && 'innerText' in el && el.innerText != s && el.innerText.trim().length > (s.length - 20) && el.innerText.trim().length < (s.length + 20)) {
els.push(el)
}
}
if (els.length == 0) return
let el = els[Math.floor(Math.random() * els.length)]
console.log(`replacing '${el.innerText}'`)
el.innerText = s
setTimeout(replace, 1000);
}
setTimeout(replace, 1000);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment