Last active
April 3, 2022 20:54
-
-
Save pagreczner/9d346547a9499c313035 to your computer and use it in GitHub Desktop.
Gist Autosave bookmark (Chrome only?)
This file contains hidden or 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(){ | |
setInterval(function(){ | |
console.log("Auto Saving..."); | |
var data = $("#gist-form").serialize(); | |
var actionUrl = $("#gist-form").attr('action'); | |
try { | |
$.post(actionUrl, data); } | |
catch(err) {} | |
$("<p class='cjs-autosave'>Autosaved gist!</p>").insertAfter("div.main #gists"); | |
$("p.cjs-autosave").fadeOut(4000); | |
}, 10000); | |
}()) |
This actually works great as a greasemonkey script as well!
Firefox declined to do it via debug console , gets NULL at line 4 or 5 ,
so i did it from shell
https://gist.github.com/benchonaut/605235721ba775ddd3df371fb287afe3
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
While on a Gist /edit page on github.com, you can click on a bookmark containing this code to have it auto save the gist every 10 seconds. Modify to your needs.
Useful for google doc autosave-esque functionality.