Skip to content

Instantly share code, notes, and snippets.

@ICBacon
Forked from tonyfast/firstnb.ipynb
Last active August 29, 2015 14:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ICBacon/9325153c88d850adffd0 to your computer and use it in GitHub Desktop.
Save ICBacon/9325153c88d850adffd0 to your computer and use it in GitHub Desktop.
Accessing Old Gists

Accessing Old Gists

Example gist SHA 0c37e47f24531557decd

  1. List the commits from the gist

    https://gist.github.com/ICBacon/0c37e47f24531557decd/commits

  2. Open the console

  3. Parse the request

    // Deserialize API request into the console
    eval('var data = ' + document.getElementsByTagName('pre')[0].innerText )
    // Get the last Gist 
    gistUrl = data.slice(-1)[0]['url']
  4. Open the Github Gist

    // Replace the api location with the html uri location
    // Open that bad boy
    window.open(gistUrl.replace('https://api.github.com/gists/','https://gist.github.com/'))
  5. Open the Raw API

    ```javascript
    

    // Open that bad boy window.open(gistUrl)

    
    1. Parse the request again
    
    ```javascript
    // Deserialize API request into the console
    eval('var data = ' + document.getElementsByTagName('pre')[0].innerText )
    
    1. Copy homeboy into the clipboard
    copy(data['files']['MyFirstNotebook.ipynb']['content'])

References

Display the source blob
Display the rendered blob
Raw
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment