Posts by PennyMonkey (15)

OneDrive on Multiple Computers

Came across a "fun" issue with OneDrive. I had been doing a ton of work and changes on 1 of 3 computers I have that are all connected to the same account. I had not turned on one of the computers for 3 months. When I finally did, it spent an endless amount of time syncing and when it was done I discovered that it overrode my most recently used computer with it's outdated files. Some were not overwritten but merged or duplicated. It took a ton of time trying to correct. -_- Thank goodness for github! It saved the day by just scrapping entire folders and re downloading projects. Still....must figure out how to NOT let that happen again.

Auto update to render changes of a template file in a Flask app

While the app is running in production mode, I noticed that whenever I changed something in a .html file it would not load the change immediately. I would have to manually restart the whole app to see the changes. I did a search and found a fix for this. Add the following line in the __init__.py file (without ""): "app.config['TEMPLATES_AUTO_RELOAD'] = True" You won't see the server auto-restart on a template change like it does in debug mode, but it does update the template and renders it as soon as you save the file.

Streamlit

I just learned it's "The Fastest Way To Build Data Apps". I'm enlightened. I could've saved months by using it, but that defeats the whole purpose of learning. Those pain staking months made me learn all the skills of a Full Stack Flask Developer using Flask, JS, HTML, CSS, and Json. For the win.

Remove a file from Git remote repo without deleting it locally

Here's a common scenario: you previously committed and pushed to a remote repo, but then decided that you don't want a certain file on the remote repo even though you'd like to keep the same file locally for personal reference. There's a way to fix that! Steps: ~$ git rm -r --cached File-or-FolderName ~$ git commit -m "Removed folder from repository" ~$ git push origin master

VS Code not recognizing your Conda Environment?

It turns out that VS Code doesn't play as well with Conda environments from Anaconda or Miniconda. Refer to the following VScode docs: https://code.visualstudio.com /docs/python /environments So to create a new Conda environment that will be recognized in your VS Code, you have to specify the python version during the creation of the environment: i.e. Create a new Conda environment using the Conda installed python version 3.8.3. ~$ conda create -n <env_name> python=3.8.3 You may also have to specify the default python path in VS Code settings to make sure that it is pointing to the correct location of the python version you want to use. For instance, Mac OS comes with python 2 by default and it's location is therefore listed first in $PATH. So that is what VS Code will default to. To change this, open VS Code, click the gear icon on the bottom left of the window, and select "Settings". Alternatively you can type the shortcut "⌘," to open the settings file too. Once there, add the setting ("python.pythonPath":) and then the path to the python executable you want to use. In my case it is within my miniconda installation: /Users/username /opt/miniconda3/bin /python3.8*

1 2 3