Sass $globals
for the full Google Material Color pallet.
I have a modest blog. One day I might care about Google Anaylitcs. For now, my basic needs are:
- Add a GA global tag to the site
head
. - Present users with a way to opt-out of GA for my site.
- Display this option on the Privacy Policy page -
Settings > Privacy
.
For this, I'm using:
Like 3M other people inspired by Tom Scott's FizzBuzz: One Simple Interview Question video, here is my 20 minute stab at FizzBuzz. I imagine a programmer would nail this in under 10 :P
I did it this way because I was curious about the different patterns variable inputs would create. The results remind me of The Rythm of Primes :)
class FizzBuzz:
'''Classic children's game in Python.
'''
Today I needed to handle a Pillow warning. Many posts demonstrate how to treat all warnings as exceptions so they can be caught with try
and exept
. I quickly discovered that catching all warnings can be problematic. Here's how to catch specific warnings:
import warnings
warnings.filterwarnings("error", category=Image.DecompressionBombWarning)
def process_images():
try:
appdirs
helps you locate OS-appropriate directories for storing app data on a user's computer - user, site, caxhe, log. I use appdirs
to write log files.
python -m pip install appdirs