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