[list] -> [list] [list] -> num
Install, Upgrade Postgres on Mac with homebrew
There are many options to install Postgres. Here we use “homebrew” (brew.sh). How to: Install Postgres on Mac with brew GOTCHA: “Wait, I just installed an older Postgres version(postgresql@14)? If you don’t specify a Postgres version, it downloads a default version that might not be the newest version or an older target version. How to:…
Timer in Terminal
main.py activate_terminal.scpt
Github Authentication with SSH on Mac
“Support for password authentication was removed on August 13, 2021.” – Github You have many options to authenticate with GitHub Why use SSH Authentication? (docs.github) How to setup SSH Authentication? Note: The HTTPS and SSH addresses are different
openai embeddings in python with asyncio and gather
Async version: Sources
Django jupyter notebook in vscode
Django jupyter notebook in browser
How do you start a jupyter notebook with all the django settings working? Step 1: Install shell_plus from django-extensions Step 2: start shell_plus with –lab Note: old documentation may suggest “–notebook” Also:
How to avoid overwriting files in python
Strategy 1: increment a suffix so like “file.pdf(1)” Version: Simple Version: Guards against race conditions The above is safe if there is only one process writing to the location but it can include a race condition. This is the safer version that “opens” the file. Strategy 2: attach a timestamp
Removing stopwords with NLTK
Code with explanations: Just the code
How to write files and read files in python
In short How would you optimize saving expensive API calls? Explanation Say you have a function with output you want to save. It could be from: Step: Create the directory you are saving to. I usually write to the system tmp directory or a project tmp tmp directory and put “tmp” in my gitignore so…