Last active
March 3, 2020 14:55
-
-
Save dschep/bd2803112f427fcf6ae52c85275229c7 to your computer and use it in GitHub Desktop.
Restore AWS shortcuts
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:(() => { | |
const newSc = prompt('enter shortcuts to restore'); | |
/* Parse cookies into a map */ | |
const cookies = new Map(document.cookie.split(/\s*;\s*/g).map(kv => kv.split('='))); | |
/* decode and parse the noflush_awscnm cookie */ | |
const noflush_awscnm = JSON.parse(decodeURIComponent(cookies.get('noflush_awscnm'))); | |
/* set shortcuts to those input by user */ | |
noflush_awscnm.sc = newSc.split(','); | |
/* set the noflush_awscnm cookie (stringified & encoded) */ | |
document.cookie = `noflush_awscnm=${encodeURIComponent(JSON.stringify(noflush_awscnm))}`; | |
/* inform the user */ | |
alert(`reset shortcuts: ${newSc}`); | |
})() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Easy install here: http://dschep.github.io/GistMarklets/#bd2803112f427fcf6ae52c85275229c7
matching bookmarklet to read your current favorites here: https://gist.github.com/dschep/1f3521ebd65ac569a13d0a0daf508031