Skip to content

Instantly share code, notes, and snippets.

View pschonev's full-sized avatar

Philipp Schoneville pschonev

View GitHub Profile
@patx
patx / benchmark.md
Last active December 25, 2025 23:34

ASGI Framework Performance Benchmark

Introduction

This benchmark compares the performance of various ASGI web frameworks when serving a simple "Hello, World!" response under high concurrency. The test setup includes running each framework with Uvicorn (4 workers) where applicable and using wrk to simulate concurrent requests.

Test Setup

Each framework was tested using the following command:

wrk -t4 -c1000 -d30s http://127.0.0.1:8000/
@ZhuoyunZhong
ZhuoyunZhong / 01_Overview.md
Last active March 13, 2026 15:07
Include only parts of others' repository as submodule in your project and arrange them to desired locations.

This gist provides an example of how to only include parts of others' repository as submodule in your project.

What is more, it will also show how to "put" the folders of submodule to desired location (e.g. under your project's root), without breaking the submodule.

Consider we have a repository

Simulation

  • README.md

There is one another repository we want to use, but only the algorithm folder is needed.

import os
import re
import sys
from urllib.parse import urlparse, urlunparse
import toml
PIPFILE_TO_UV_DEP_NAMES = {"packages": "dependencies", "dev-packages": "dev-dependencies"}
@nkhitrov
nkhitrov / structlog_fastapi.py
Created March 16, 2023 00:04
Structlog FastAPI example
"""
Structlog example configuration with FastAPI.
Features:
- async bound logger
- contextvars to log request-id and other meta data
- custom format for default logging loggers and structlog loggers
"""
import asyncio
import logging
@emisjerry
emisjerry / capture-format-test
Created September 12, 2021 02:46
Capture-format: test using QuickAdd inline javascript
```js quickadd
selection = window.getSelection();
selText = selection.toString()
console.log("selection", selText);
const activeFile = this.app.workspace.getActiveFile();
if (!activeFile) {
new Notice("No active file", 5000);
return;
}
console.log("active file=", activeFile);
@rahularity
rahularity / work-with-multiple-github-accounts.md
Last active March 16, 2026 08:44
How To Work With Multiple Github Accounts on your PC

How To Work With Multiple Github Accounts on a single Machine

Let suppose I have two github accounts, https://github.com/rahul-office and https://github.com/rahul-personal. Now i want to setup my mac to easily talk to both the github accounts.

NOTE: This logic can be extended to more than two accounts also. :)

The setup can be done in 5 easy steps:

Steps:

  • Step 1 : Create SSH keys for all accounts
  • Step 2 : Add SSH keys to SSH Agent
@rvaidya
rvaidya / database_to_parquet.py
Last active February 24, 2025 11:24
Dump database table to parquet file using sqlalchemy and fastparquet. Useful for loading large tables into pandas / Dask, since read_sql_table will hammer the server with queries if the # of partitions/chunks is high. Using this you write a temp parquet file, then use read_parquet to get the data into a DataFrame
import pandas as pd
import numpy as np
import fastparquet
from sqlalchemy import create_engine, schema, Table
# Copied from pandas with modifications
def __get_dtype(column, sqltype):
import sqlalchemy.dialects as sqld
@suewonjp
suewonjp / Edit and review github wiki on your local machine.md
Last active October 29, 2025 08:56
Edit and review github wiki on your local machine
First, clone your github wiki to your local machine
  1. Checkout your repository wiki via git.
     - You can find the URL at the lower-right of your wiki page (look for the label "Clone this wiki locally")
  2. Now that you have pulled down a local copy of your github repo wiki, create a new file in the repo called _Sidebar.md  - Note that other names might not work.
  3. Within the newly created _Sidebar.md file, you can add appropriate [[link]] markdown syntax.
  4. Add your new file to the local repository, and push via git push origin master.

With the same procedure, you can add a header(_Header.md) and footer(_Footer.md) file.

@tmilos
tmilos / README.md
Last active December 23, 2025 00:31
Modified Preorder Tree Traversal

Modified Preorder Tree Traversal

Hierarchical data metrics that allows fast read operations on tree like structures.

Based on Left and Right fields that are set during tree traversal. When entered into node value is set to it's Left, when exiting node value is set to it's Right.

Sample implementation