Skip to content

Instantly share code, notes, and snippets.

View zhangr4's full-sized avatar

zhangr4 zhangr4

View GitHub Profile
@PrashantUnity
PrashantUnity / Resume.cs
Created May 16, 2023 08:59
Creating Resume Using CSharp Language and QuestPdf Library
using QuestPDF.Fluent;
using QuestPDF.Helpers;
using QuestPDF.Infrastructure;
using QuestPDF.Previewer;
using SkiaSharp;
QuestPDF.Settings.License = LicenseType.Community;
Document.Create(container =>
{
container
@spaasis
spaasis / SwaggerFeatureGateFilter.cs
Last active March 25, 2025 03:06
Swashbuckle IDocumentFilter for hiding paths based on IFeatureManagement and FeatureGateAttribute
using Microsoft.AspNetCore.Mvc.Controllers;
using Microsoft.FeatureManagement;
using Microsoft.FeatureManagement.Mvc;
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.SwaggerGen;
/// <summary>Checks the current Feature Management configuration and removes all paths with disabled features</summary>
public class SwaggerFeatureGateFilter : IDocumentFilter {
private readonly IFeatureManager _featureManager;
@CMCDragonkai
CMCDragonkai / http_streaming.md
Last active March 14, 2025 01:20
HTTP Streaming (or Chunked vs Store & Forward)

HTTP Streaming (or Chunked vs Store & Forward)

The standard way of understanding the HTTP protocol is via the request reply pattern. Each HTTP transaction consists of a finitely bounded HTTP request and a finitely bounded HTTP response.

However it's also possible for both parts of an HTTP 1.1 transaction to stream their possibly infinitely bounded data. The advantages is that the sender can send data that is beyond the sender's memory limit, and the receiver can act on