![]() To get around the CORS issue, I created a super simple ColdFusion API end-point that does nothing but grab the Gist JSON and return it. Invaders from 78 is written in Typescript, implements a small ECS. What I need is to be able to load the Gist content from my own domain. The difficulty ramping could use a little tuning, it hews close to the relentless. ![]() Unfortunately, when I attempted to load this JSON file using the fetch() API, I received a CORS (Cross-Origin Resource Sharing) error since the Gist API isn't including the necessary Access-Control-Allow-Origin HTTP header. Over the weekend, however, I learned from Miguel Piedrafita that you could retrieve a GitHub Gist as JSON (JavaScript Object Notation) by using a. This will block-and-load a JavaScript file that has two document.write() calls in it: one for the Stylesheet and one for the HTML markup. js file that is based on the ID of the gist. But, as of this morning, I'm no longer doing that - I'm loading the Gist as JSON (JavaScript Object Notation) using a proxy end-point in ColdFusion. ![]() In order to load my Gists after the DOM (Document Object Model) is ready, I have to override the document.write() implementation in order to create a sort of man-in-the-middle attack to programmatically capture the Gist content. Set cues, fades and shift multiple tracks in time. However, embedding a gist is rather strange in that it uses a JavaScript file to execute document.write() calls that render the Gist Stylesheet and the HTML markup. Multitrack Web Audio editor and player with canvas waveform preview. The entire impetus for this is that when you embed a gist, it's beautifully formatted with line-numbers and syntax highlighting. That said, both formats work perfectly well when the username is included.Ībout a decade ago, I started looking into hosting my code samples using GitHub gists. Multi-room audio control / Monitor with WebRTC, Web Audio API, Node. It seems that the username isn't necessary for the newer Gist IDs but is necessary for the older Gist ID formats. More than 83 million people use GitHub to discover, fork, and contribute to over. I am a determined life-long learner and creator, as passionate about well-designed technology and software products as I am about meticulously crafted music. After looking at the Gist detail and seeing the embed code, I ended-up changing the Gist URL to include my username: The Gist ID was shorter (only 7-characters long, not 32-characters). UPDATE (): After deploying this proxy end-point, I noticed that an old Gist from years ago wasn't loading (returning a 404).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |