6

GitHub Gists Hack – PIBB Extension

 10 months ago
source link: https://cwestblog.com/2023/06/28/github-gists-hack-pibb-extension/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

GitHub Gists Hack – PIBB Extension

Published by Chris West on June 28, 2023

Have you ever wanted to source a GitHub Gist within an <iframe>? Yesterday, I was writing a trainual document for work that needed to include Apex code which of course includes code that is misinterpreted as HTML ( eg. List<Object>…) after you save it and want to edit it again. According to this page, the suggested way to get around this issue is by using Pastebin. I honestly wanted to use GitHub Gists since as a developer I always use GitHub anway. Finally I found a way to embed a Gist as an <iframe>:

Do you see what I did? The URL to the Gist that I wanted to put in the <iframe> was https://gist.github.com/westc/025d8ff780f8d524086ab44760fe9975 so all I had to do was add “.pibb” as the extension and then the Gist was able to be embedded.

Embed A Specific File

It seems that you can also just include a specific file by specifying the file name as the “file” URL parameter:

In this example all I did was include ?file=sameSign.js to indicate that all I want to appear in the <iframe> is the code for sameSign.js.

Conclusion

This may prove to be a useful solution but unfortunately I have not found any official documentation for this functionality by GitHub. If you find any documentation please let me know. Anyway, I hope this proves useful to others and as always, happy coding!!! 😎


Leave a Reply Cancel reply

placeholder.jpg
Name *
Email *
Website

Save my name, email, and website in this browser for the next time I comment.

6  +   =  eleven

What's on your mind?

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK