Category Archives: JavaScript

Using Node-RED as a front-end to your software

Node-RED is an, open-source, visual programming tool that lets you wire together hardware (such as sensors), APIs (such as REST/POST) and custom functions. However, its custom functions aren’t simply the JavaScript you write, they can also be containers!

This can provide an intuitive front-end to otherwise difficult software. For example, you’ve written your magnum opus, you’ve even documented it (though no-one will ever read it) and to ensure maximum compatibility for the widest possible audience, you’ve containerised it. But it’s still a command-line driven application. Using node-RED you can make this accessible to an inexperienced audience.

Out of the box, node-RED’s quite pretty, you can string together nodes to perform functions that are useful. In this case, it’s for monitoring a log file, if the log doesn’t grow, something’s gone wrong, so email me to take a look at it.

Continue reading

Reproducible publishing

I’m a big fan of Jupyter Notebooks. They’re a great way to document and explain code, and even better, you can run this code when connected to an appropriate kernel.

What if you want to work on something larger than a notebook? Say a chapter or even a whole book, with Python, R, Observable JS, or Julia code? Enter Quarto. You can combine Jupyter notebooks and/or plain text markdown to publish production quality articles, presentations, dashboards, website, blogs and books in HTML, PDF, Microsoft Word, ePub, and other formats. Quarto can also connect to publishing platforms like Posit Connect, Confluence Cloud, and others.

Continue reading

Interactive visualization of protein–ligand complexes with Py3Dmol

I recently had a problem where I wanted to provide an interactive visualization of multiple different protein–ligand complexes, requiring minimal setup by the user, allowing them to zoom in and out and change the visualization style, without just providing multiple PDB files or a PyMOL session.

Continue reading

Coding a Progress Bar for your Google Slides Presentation

Presentations are a great opportunity to explain your work to a new audience and receive valuable feedback. A vital aspect of a presentation is keeping the audience’s attention which is generally quite tricky I have found (from experience).

One thing that I have noticed other presenters using, which has helped maintain my focus, is an indication of the progression of the presentation. Including in your slides information that there are only a few slides remaining, encourages the listeners to keep their focus for a little longer.

Instead I will show you how to do it using Apps Script, Google’s cloud platform that allows you to write JavaScript code which can work with its online products such as Docs or Slides.

Continue reading