I have a gist with some javascript code in a script
tag, like so:
<script src="https://raw.github.com/gist/b25dff23c2c4b4bd425a/f157aa95163311c4b58febb06b49ffd16419f642/images.js"></script>
And I will need to keep editing the JS file on github. However, when you edit a gist it changes the URL of the gist. How do I keep the same URL?
We can edit, delete, unsubscribe, star, embed, copy, share, and download a raw copy or zipped copy of a gist. We also can share a gist in multiple ways. You can opt to embed the gist into a website, copy a shareable link to send, clone (or copy) the gist via the git command to a local repository or via SSH.
Secret gists are not searchable and do not show up in Discover. They can only be used for your own purposes, as you cannot share them. If you want to create a public gist, make sure this option is deselected. Public gists are searchable, and they show up in Discover where people can browse newly appearing gists.
You can still convert a secret gist to a public gist by first selecting "Edit" -> "Make Public".
Gist changed the path to this file pattern:
https://gist.github.com/<USER_NAME>/<GIST_ID>/raw/<GIST_REVISION_ID>/<GIST_FILE_NAME>
You will notice that now the top answers' links are 404'ing.
Simply apply this new pattern and voilà!
https://gist.github.com/<USER_NAME>/<GIST_ID>/raw/<GIST_FILE_NAME>
For instance:
https://gist.githubusercontent.com/wesbos/cd16b8b1815825f111a2/raw/lol.js
In case of gist,https://raw.github.com/gist/[gist_id]
ORhttps://gist.github.com/[user_name]/[gist_id]/raw
(which is more likely to be an unique URI.)
returns first file from the gist.
For gist with multiple files, https://raw.github.com/gist/[gist_id]/[file_name]
The url works even when you change the filename.
e.g. https://raw.github.com/gist/4636655 https://raw.github.com/gist/4636655/imdb-getglue.js
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With