It simply works by appending /raw into the URL and return the content.
/raw
https://gist.github.com/aaanh/2d8b322170ec9fa3c2273e7b92b48327
Gist is a code or text snippet that is hosted on Github. Docs here.
It functions similarly to pastebin.