Though I wrote the plugin initially for personal use, now the same is available for you to use in your WordPress sites.
You can either download it from the directory, or install directly within your WordPress installation. Here is a live demo of the plugin:
Show a file, preferably source code file content in a WordPress blog post or page. This plugin shows always the latest code from GitHub.
Visit my GitHub repository to download the plugin for free – https://github.com/ninethsense/wp-ShowGithubFile
Source Code: (Live Example directly from GitHub 🙂