Last active
December 16, 2015 08:58
-
-
Save prettycode/5409158 to your computer and use it in GitHub Desktop.
A function that forks a Gist. You can use this to fork your own Gists.
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
function forkGist(user, gist) { | |
var path = (arguments.length ? ('/' + user + '/' + gist) : location.pathname); | |
var form = document.createElement('form'); | |
form.method = 'post'; | |
form.action = 'https://gist.github.com' + path + '/fork', | |
form.submit(); | |
} | |
// Paste into browser console when viewing a Gist (including your own) to fork it | |
forkGist(); | |
// Fork a Gist from anywhere | |
forkGist('prettycode', 5409158); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment