Default output:
❯ python logger.py
2024-09-12 09:24:53 INFO [email protected] Hello worldOutput in a deployed env:
| # /// script | |
| # requires-python = ">=3.9" | |
| # dependencies = [ | |
| # "requests", | |
| # "PyJWT", | |
| # "cryptography" | |
| # ] | |
| # /// | |
| # | |
| """ |
| # For https://keymap-drawer.streamlit.app/ | |
| layout: {qmk_keyboard: crkbd/rev4_0/standard, layout_name: LAYOUT_split_3x6_3_ex2} | |
| layers: | |
| L0: | |
| - TAB | |
| - Q | |
| - W | |
| - E | |
| - R | |
| - T |
Default output:
❯ python logger.py
2024-09-12 09:24:53 INFO [email protected] Hello worldOutput in a deployed env:
| import requests | |
| url = 'https://api.open511.gov.bc.ca/events' | |
| params = { | |
| 'bbox': '-123.298030,49.243994,-122.975306,49.708883', | |
| 'event_type': 'INCIDENT', | |
| 'status': 'ARCHIVED', | |
| 'created': '>2024-04-13T00:00:00Z' | |
| } |
| import time | |
| from functools import wraps | |
| def retry( | |
| ExceptionToCheck: Exception, | |
| num_tries: int = 5, | |
| delay_sec: int = 3, | |
| backoff: int = 2, | |
| ): |
| locals { | |
| tables = { | |
| interval_usage = ["read_end_datetime", "ingest_datetime"] | |
| bill_detail = ["ingest_datetime"] | |
| } | |
| table_resources = { for _entry in flatten([ | |
| for k, v in local.tables : [ | |
| for partition in v: { | |
| entity = k |
| # Install xcape (https://github.com/alols/xcape) | |
| sudo pacman -S xcape | |
| # Add the following to ~/.xprofile so they're executed at startup (since these commands don't persist across sessions) | |
| setxkbmap -option caps:ctrl_modifier # Set capslock to ctrl when held | |
| xcape -e 'Caps_Lock=Escape' # Set capslock to escape when pressed |
| import csv | |
| from datetime import datetime | |
| from argparse import ArgumentParser | |
| from google.cloud import bigquery | |
| parser = ArgumentParser() | |
| parser.add_argument("project_id") | |
| parser.add_argument("--output_filename", default=None) | |
| parser.add_argument("--num_jobs", default=10000, type=int) |
| import json | |
| import os | |
| import sys | |
| import time | |
| from argparse import ArgumentParser | |
| from uuid import uuid4 | |
| from faker import Faker # pip install faker | |
| fake = Faker() |