Skip to content

Instantly share code, notes, and snippets.

@nu774
nu774 / asgiecho.py
Created August 25, 2022 04:29
ASGI app that iteratively echo backs request body
async def application(scope, receive, send):
if scope['type'] != 'http':
return
initial = True
more_body = True
while more_body:
chunk = await receive()
if chunk['type'] != 'http.request':
break
body = chunk['body']
@nu774
nu774 / main.c
Created March 26, 2025 07:17
scan chained oggflac file with libFLAC 1.5+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <FLAC/stream_decoder.h>
#include <FLAC/format.h>
typedef struct context_t {
FLAC__StreamMetadata_StreamInfo si;
FLAC__StreamDecoderErrorStatus err;
char **vc;