Normally, I have Jenkins checkout of a git repo to do a build. However, there are times where I just need it to run an individual script. It seems rather wasteful to add it to an existing repo, since Jenkins would checkout out the entire repo to run a single script. Additionally, it doesn't make sense to create a repo for a single script. That's probably why Github has gists.
So, here's how I currently get Jenkins to checkout a gist by adding the following to the shell build step.
The first command disables host checking on the slave and the second command will clone the repo to the local workspace.
So why do I disable the host check? Since my jenkins slave is dynamically provision, I don't maintain a known hosts file. Plus, when the job is done, the server is destroyed.