Python 3 logging setup

Doing a few things here: Showing log output in the console Writing log output to a file Set logger level import logging LOG_FILE = “your_log_file.log” logger = logging.getLogger(__name__) # Set up console handler for logging ch = logging.StreamHandler() # Set up file handler for logging fh = logging.FileHandler(LOG_FILE) # Make the log messages look nice…

Continue Reading

Smooth scroll to webpage elements using jQuery

While working on revamping my online portfolio, I wanted a scroll effect after clicking on menu items — the default “jump to” activity was abrupt, and after designing my Celebrity Name Game and becoming spoiled on effects, I thought it was a good move. Turns out, however, that it’s unwieldy to try and get jQuery…

Continue Reading

PHP Menu Highlighter

PHP Menu Highlighter – highlight current page in your navigation menu. While developing a website recently, I realized I had already produced the navigation menu in a PHP file and used the include function to pull it into each page, so I needed a way to highlight the current page’s navigation menu item: This uses…

Continue Reading