Exploring the Python AST
Whilst working on, and learning about, a python wrapper around a WebAPI it came to the point of writing some tests. Because I want to test my code, and not the underlying API I am learning about mocking. To mock the API (and for checking coverage of the API) it is desirable to have an exhaustive list of all the API endpoints. This list could be obtained from the documentation (scraping) or in this case by looking at the scripts that generate the documentation.
Embedding Jupyter Notebook directly from gist
Previous options for embedding Jupyter Notebooks in Jekyll were not satisfactory / left some things to be desired. For some time now it has become a lot less cumbersome because GitHub added advanced support for Jupyter. On a gist you can copy the generated html snippet like so:
Now you can paste this in your jekyll page which will automatically load/render everything nicely (or so it seems). Happy times! It would be even better to be able to control the height of the embedded content, but honestly, the gist is just one click away.
Download all videos from Safari Books Online course
Updating some of my certifications and wanted an offline way to watch a video course. Since they do not offer a way to download an entire course (except for the queue app, which is not what I’m after) I created this notebook to scratch that itch.
Only tested with this specific course, it might need some minor tweaks for other courses. The structure of the course material seems somewhat inconsistent, but this should be a good starting point for other courses.
Datastore exploration in RES Automation Manager – Part 6
It’s been a while since the last post, but I wanted to share this pearl in RESAM I came across today with regard to the dispatcher discovery process. There are three settings which dictate the agent’s behaviour, but it is more involved than just three switches. As there is only a pdf “instant report” available from the RES console I went down the rabbit hole again to create something more useful.
iPython Notebooks in Jekyll
My solution for integrating an iPython notebook in Jekyll. It uses an iframe around an nbviewer page referring to a github gist.
The CSS to make the iframe resize nicely was stolen from Michael Lancaster and I add an inline style in the outer div tag to set the height. It would be nice to have that automatically, but as far as I can tell that’s not possible without some javascript voodoo I prefer to avoid.