Here's a summary of common Python time conversions
Some methods drop fractions of seconds, and are marked with (s).
Here's a summary of common Python time conversions
Some methods drop fractions of seconds, and are marked with (s).
| from confluent_kafka import Consumer, Producer, KafkaError, KafkaException | |
| class Kafka: | |
| def __init__(self, bootstrap_server, topic, timeout=1.0): | |
| self.__bootstrap_server = bootstrap_server | |
| self.__topic = topic | |
| self.__timeout = timeout | |
| @staticmethod |
| import asyncio | |
| from confluent_kafka import Consumer, Producer | |
| from confluent_kafka.admin import AdminClient, NewTopic | |
| BROKER_URL = "PLAINTEXT://localhost:9092" | |
| TOPIC_NAME = "my-first-python-topic" |
| "workbench.colorCustomizations": { | |
| // Contrast Colors - The contrast colors are typically only set for high contrast themes. If set, they add an additional border around items across the UI to increase the contrast. | |
| "contrastActiveBorder": "", | |
| "contrastBorder": "", | |
| // Base Colors | |
| "focusBorder": "", | |
| "foreground": "", | |
| "widget.shadow": "", | |
| "selection.background": "", | |
| "descriptionForeground": "", |
| # Starting with Django 4.1+ we need to pick which template loaders to use | |
| # based on our environment since 4.1+ will cache templates by default. | |
| default_loaders = [ | |
| "django.template.loaders.filesystem.Loader", | |
| "django.template.loaders.app_directories.Loader", | |
| ] | |
| cached_loaders = [("django.template.loaders.cached.Loader", default_loaders)] |
| #!python3 | |
| """ | |
| Convert a requirements.txt file to a Poetry project. | |
| Just place in the root of your working directory and run! | |
| """ | |
| sourceFile = "./requirements.txt" | |
| import re | |
| import os |
Homebrew makes it easy to install and keep installed software up to date on your Mac - as part of my backup routine for my Mac I want to be able to run a single command to reinstall all packages.
If you're searching on how to backup & restore Homebrew, then I assume you're here for the commands.
Brewfiles are files generated with definitions that Homebrew reads and processes, a generated
| # Make sure that the .gnupg directory and its contents is accessibile by your user. | |
| chown -R $(whoami) ~/.gnupg/ | |
| # If not, run this: | |
| sudo chown -R $USER ~/.gnupg | |
| # Then give the right permissions: | |
| sudo chmod 700 ~/.gnupg | |
| sudo chmod 600 ~/.gnupg/* |
| import logging | |
| import requests | |
| from fastapi import FastAPI, Request | |
| from fastapi.middleware.cors import CORSMiddleware | |
| from fastapi.middleware.gzip import GZipMiddleware | |
| from fastapi.responses import HTMLResponse, RedirectResponse | |
| from fastapi.staticfiles import StaticFiles | |
| from fastapi.templating import Jinja2Templates |