Skip to content

Instantly share code, notes, and snippets.

@atenni
Last active December 24, 2025 04:19
Show Gist options
  • Select an option

  • Save atenni/5604615 to your computer and use it in GitHub Desktop.

Select an option

Save atenni/5604615 to your computer and use it in GitHub Desktop.

Revisions

  1. atenni revised this gist May 18, 2013. No changes.
  2. atenni revised this gist May 18, 2013. 1 changed file with 6 additions and 6 deletions.
    12 changes: 6 additions & 6 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -1,14 +1,14 @@
    **Problem:** When linking to the raw version of a Gist, the link changes with each revision.
    **Problem:** When linking to the raw version of a gist, the link changes with each revision.

    **Solution:**

    `https://raw.github.com/gist/[gist_id]` returns first file from the gist.
    To return the first file from a gist: `https://gist.github.com/[gist_user]/[gist_id]/raw/`

    For gist with multiple files: `https://raw.github.com/gist/[gist_id]/[file_name]`
    * Example: <https://gist.github.com/atenni/5604522/raw/>
    * Works even when you change the filename.

    The url works even when you change the filename:
    To get a file from multi–file gist: `https://gist.github.com/[gist_user]/[gist_id]/raw/[file_name]`

    * https://raw.github.com/gist/4636655
    * https://raw.github.com/gist/4636655/imdb-getglue.js
    * Example: <https://gist.github.com/atenni/5604522/raw/README.md>

    _(via: <http://stackoverflow.com/a/14529686>)_
  3. atenni created this gist May 18, 2013.
    14 changes: 14 additions & 0 deletions README.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    **Problem:** When linking to the raw version of a Gist, the link changes with each revision.

    **Solution:**

    `https://raw.github.com/gist/[gist_id]` 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:

    * https://raw.github.com/gist/4636655
    * https://raw.github.com/gist/4636655/imdb-getglue.js

    _(via: <http://stackoverflow.com/a/14529686>)_