Quick Tips
My React.js Notes from Udemy – React – The Complete Guide
The following are my notes from Udemy – React – The Complete Guide. They are automatically fetched from this file in my GitHub repo. Please see that repo for my notes from other React courses such as this one from Linkedin Learning.
Shallow Copy vs Deep Copy in JavaScript and Python
The issue of preventing future mutation of the copied original exists both in JavaScript and Python. In Python, both lists and dictionaries are mutable reference types, similar to arrays and objects in JavaScript. When you copy these structures, you must be aware of whether you are making a shallow or deep copy. Deep Copy vs…
My React.js Notes from Linkedin Learning – React Essential Training
The following are my notes from React.js Essential Training from LinkedIn Learning. They are automatically fetched from this file in my GitHub repo. Please see that repo for my notes from other React courses such as this one from Udemy.
Troubleshooting Web Applications Deployed with CapRover in Docker Containers
Jump into the terminal of a CapRover app named testapp. Use Ctrl + P, then Ctrl + Q to exit that terminal without killing the container. Logs of the deployed application (–follow keeps retrieving the latest events): CapRover logs: Logs for Docker itself (if your application keeps getting respawned in new containers, the answer may…
SFTP File Operations with Python Using an SSH Key
Below are some functions to read, write, and delete a file, list a directory, and check if a file exists in a remote SFTP server with Python. I have written these specifically for working with CSV files and pandas data frames. The argument file in the functions below should be the full path to the…
12 Principles for Building Software as a Service Apps
The Twelve Factors: # Factor Description I Codebase There should be exactly one codebase for a deployed service with the codebase being used for many deployments. II Dependencies All dependencies should be declared, with no implicit reliance on system tools or libraries. III Config The configuration that varies between deployments should be stored in the…
How to Take a Screenshot of a Website in Python Silently with Selenium
The code below will make a browser 1920px wide, and as long as the page and take its screenshot: If the page needs to load asynchronously to complete building the DOM, you may need to give it a few seconds before taking the screenshot: If the page requires scrolling down to load the rest of…
Changing the Directory Used by Docker
If you want to have the docker images kept in another directory, such as a mounted volume: Then place the following after updating “/mnt” with your target path. Restart Docker: The old Docker directory will not be used anymore so you can remove it by:
Downloading All Files in a Directory from a Jupyter Notebook Server
Problem When you are following a tutorial with exercises on a Jupyter Notebook Server, you may want to download and work with those files locally, but there is no obvious way to download all files as the Download button disappears when multiple files/folders are selected. Solution Step 1 Click on the Jupyter logo on the…