Skip to content

Instantly share code, notes, and snippets.

View JacopoWolf's full-sized avatar
:octocat:
git commit --suicide

Jiulia JacopoWolf

:octocat:
git commit --suicide
  • Italy
  • 21:20 (UTC +02:00)
View GitHub Profile
@JacopoWolf
JacopoWolf / ApiVersionRouteParameterOperationFilter.cs
Created September 8, 2022 09:28
ASP.NET OpenApi SwaggerUI default version
// inspired by https://stackoverflow.com/questions/69899771/add-default-value-to-swagger-path-parameters
// this filter adds the latest controller or action version to the swagger ui parameters
// so when [Route("api/v{version:apiVersion}/[controller]")]
// in swaggerUI the version will be an additional required parameter to fill in.
// This filter will add a default value for the latest
internal class ApiVersionRouteParameterOperationFilter : IOperationFilter
{
internal static IEnumerable<T> GetControllerAndActionAttributes<T>( OperationFilterContext context ) where T : Attribute
{
@JacopoWolf
JacopoWolf / MonitorController.cs
Last active April 23, 2023 15:27
ASP .NET controller to monitor currently registered routes
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.ActionConstraints;
using Microsoft.AspNetCore.Mvc.Infrastructure;
// namespace here
[ApiController]
[Route("api/[controller]")] // update route with your preference here
public class MonitorController : ControllerBase
{
@JacopoWolf
JacopoWolf / youdied.css
Last active October 29, 2023 19:27
Dark Souls-style YOU DIED popup text
@font-face {
font-family: "Optimus Princeps";
/* you'd have to download the font somewhere */
src: url('OptimusPrinceps.ttf') format('ttf');
}
body{
text-align: center;
}
dialog.ds-popup{
/* box */
@JacopoWolf
JacopoWolf / visionstatement.md
Created December 31, 2019 17:19
Vision Statement Template