Skip to content

Instantly share code, notes, and snippets.

@cowboy
Last active June 4, 2023 05:29
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save cowboy/0dd7e54d70db20d647ae8a3d4d8cd6f6 to your computer and use it in GitHub Desktop.
Save cowboy/0dd7e54d70db20d647ae8a3d4d8cd6f6 to your computer and use it in GitHub Desktop.
Universal Paperclips: stuff to paste into console http://www.decisionproblem.com/paperclips
_toggles = {}
makeToggle = (id, fn, delay = 250) => {
const elem = document.querySelector('#' + id)
elem.onclick = () => {
if (_toggles[id]) {
clearInterval(_toggles[id])
_toggles[id] = null
} else {
_toggles[id] = setInterval(() => elem.disabled || fn(), delay)
}
}
}
makeToggle('btnMakePaperclip', () => clipClick(1))
makeToggle('btnQcompute', qComp)
makeToggle('btnMakeProbe', makeProbe)
makeToggle('btnAddProc', addProc)
makeToggle('btnAddMem', addMem)
@BrisK1w1
Copy link

how does it work?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment