| // HOW TO INSTRUCTIONS | |
| // 1. Open Claude Desktop | |
| // 2. Go to Help -> Enable Developer Mode | |
| // 3. Navigate Developer Tools window named "Developer Tools - https://claude.ai" | |
| // 4. Go to "Console" tab | |
| // 5. Type "allow pasting" and hit Enter | |
| // 6. Paste this snippet and hit Enter | |
| // From now on, all MCP calls will be auto-approved |
| { | |
| "Next Typescript React Functional Component": { | |
| "prefix": "fc", | |
| "body": [ | |
| "import { FC } from 'react';", | |
| "", | |
| "interface ${TM_FILENAME_BASE}Props {", | |
| " $1", | |
| "}", | |
| "", |
| import boto3, json, os, shutil, subprocess | |
| from argparse import ArgumentParser | |
| """ | |
| Big Chalice Deployer deployes Chalice Apps using the "chalice package ..." command and | |
| modifies the resulting sam.json template to make use of the Docker deployment process | |
| instead of the default, s3 based, process. Additionally, the ability to delete the | |
| resulting SAM App is available via the CLI. | |
| Usage: |
| from stable_diffusion_videos.stable_diffusion_walk import walk | |
| prompt_n_seed = { | |
| "1965 Porsche 911": 743, | |
| "1975 Porsche 911": 140, | |
| "1985 Porsche 911": 40, | |
| "1995 Porsche 911": 560, | |
| "2005 Porsche 911 directly facing camera": 996, | |
| "2015 Porsche 911": 283, | |
| "2020 Porsche 911": 116, |
| import torch | |
| from diffusers import StableDiffusionPipeline | |
| from torch import autocast | |
| import random | |
| import matplotlib.pyplot as plt | |
| import os | |
| prompts = [ | |
| "1965 Porsche 911", |
This logging setup configures Structlog to output pretty logs in development, and JSON log lines in production.
Then, you can use Structlog loggers or standard logging loggers, and they both will be processed by the Structlog pipeline (see the hello() endpoint for reference). That way any log generated by your dependencies will also be processed and enriched, even if they know nothing about Structlog!
Requests are assigned a correlation ID with the asgi-correlation-id middleware (either captured from incoming request or generated on the fly).
All logs are linked to the correlation ID, and to the Datadog trace/span if instrumented.
This data "global to the request" is stored in context vars, and automatically added to all logs produced during the request thanks to Structlog.
You can add to these "global local variables" at any point in an endpoint with `structlog.contextvars.bind_contextvars(custom
I could not find a proper full configuration for this online, and I know I'll need this again in the future.
There are two ways to achieve this with some plugins; one via hitting the shell and doing an in-place replace, the other is by doing it with extensions configurable in vscode. Both should give you the same results.
| (defun codex-refactor (&optional b e) | |
| (interactive "r") | |
| (shell-command-on-region b e "codex-refactor.py" nil nil)) |
| # tools from https://github.com/ibraheemdev/modern-unix | |
| tap "cantino/mcfly" | |
| tap "clementtsang/bottom" | |
| brew "bat" | |
| brew "exa" | |
| brew "lsd" | |
| brew "git-delta" | |
| brew "dust" | |
| brew "duf" | |
| brew "broot" |