I hereby claim:
- I am timsavage on github.
- I am timsavage (https://keybase.io/timsavage) on keybase.
- I have a public key whose fingerprint is B8B4 CB98 C8A8 4138 376E B77A AE89 3004 2ACF 1BA1
To claim this, I am signing this object:
default_app_config = 'myapp.auth.apps.MyAuthAppConfig' |
from jinja2 import Template, Environment | |
# The environment is used to configure the template engine | |
# See: http://jinja.pocoo.org/docs/dev/api/#jinja2.Environment | |
env = Environment(autoescape=False, optimized=False) | |
# Open your template and compile into a template object. | |
with open("template.txt", "r") as f: | |
template = env.from_string(f.read()) |
# While this code still works, I would recommend using Fast API for websockets in modern applications. | |
# See: https://fastapi.tiangolo.com/advanced/websockets/ | |
# Note this is targeted at python 3 | |
import tornado.web | |
import tornado.httpserver | |
import tornado.ioloop | |
import tornado.websocket | |
import tornado.options |
I hereby claim:
To claim this, I am signing this object:
#! /usr/bin/env python3 | |
""" | |
Script for syncing static websites to S3. Requires Python 3.6+ | |
- Uses ETags to determine if a file has changed. | |
- Cleans up remote files. | |
- Sets public ACLs | |
- Supplies the correct content-type | |
- Uses GZip encoding for appropriate file types. |
# Python Prime Sieve | |
# | |
# MyFirstPython Program (tm) Dave Plummer 8/9/2018 | |
# | |
# This is the main prime_sieve class. Call it with the number you wish as an upper limit, then | |
# call the runSieve method to do the calculation. printResults will dump the count to check validity. | |
# | |
# Updated 3/22/2021 for Dave's Garage episode comparing C++, C#, and Python | |
from sys import stdout # So I can print without an automatic python newline |
import shutil | |
import subprocess | |
import time | |
COMMANDS = [shutil.which("lsmod")] | |
MOD_NAME = b"uvcvideo" | |
def get_uvc_user_count() -> int: | |
""" |