This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Net.Http.Json; | |
using System.Text.Json; | |
using System.Text.Json.Serialization; | |
var endpoint = "https://<endpoint>.<region>.models.ai.azure.com/"; | |
var apiKey = ""; | |
var inputFilePath = @""; // The path of the source PDF | |
var outputFilePath = @""; // The path of the destination Markdown file |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: "3.8" | |
services: | |
db: | |
image: postgres | |
container_name: local_pgdb | |
restart: unless-stopped | |
ports: | |
- "5432:5432" | |
environment: | |
POSTGRES_USER: pi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Project> | |
<PropertyGroup> | |
<PathMap>$(MSBuildThisFileDirectory)=./</PathMap> | |
</PropertyGroup> | |
</Project> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Diagnostics; | |
using FluentValidation; | |
using Microsoft.AspNetCore.Mvc; | |
using OperationResults.AspNetCore.Http; | |
namespace MinimalApi.Filters; | |
public class ValidatorFilter<T>(IValidator<T> validator, OperationResultOptions options) : IEndpointFilter where T : class | |
{ | |
public async ValueTask<object?> InvokeAsync(EndpointFilterInvocationContext context, EndpointFilterDelegate next) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Diagnostics; | |
using FluentValidation; | |
using Microsoft.AspNetCore.Mvc; | |
namespace MinimalApi.Filters; | |
public class ValidatorFilter<T>(IValidator<T> validator) : IEndpointFilter where T : class | |
{ | |
public async ValueTask<object?> InvokeAsync(EndpointFilterInvocationContext context, EndpointFilterDelegate next) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
builder.Services.AddControllers(options => | |
{ | |
options.Conventions.Add(new RouteTokenTransformerConvention(new SlugifyParameterTransformer())); | |
}); | |
public class SlugifyParameterTransformer : IOutboundParameterTransformer | |
{ | |
public string? TransformOutbound(object? value) | |
=> value is null ? null | |
: Regex.Replace(value.ToString()!, "([a-z])([A-Z])", "$1-$2", RegexOptions.CultureInvariant).ToLowerInvariant(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Remove the line below if you want to inherit .editorconfig settings from higher directories | |
root = true | |
[*] | |
#### Core EditorConfig Options #### | |
# Indentation and spacing | |
indent_size = 4 | |
indent_style = space |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<#@ template hostSpecific="true" debug="false" #> | |
<#@ assembly name="Microsoft.EntityFrameworkCore" #> | |
<#@ assembly name="Microsoft.EntityFrameworkCore.Design" #> | |
<#@ assembly name="Microsoft.EntityFrameworkCore.Relational" #> | |
<#@ assembly name="Microsoft.Extensions.DependencyInjection.Abstractions" #> | |
<#@ parameter name="EntityType" type="Microsoft.EntityFrameworkCore.Metadata.IEntityType" #> | |
<#@ parameter name="Options" type="Microsoft.EntityFrameworkCore.Scaffolding.ModelCodeGenerationOptions" #> | |
<#@ parameter name="NamespaceHint" type="System.String" #> | |
<#@ parameter name="ProjectDefaultNamespace" type="System.String" #> | |
<#@ import namespace="System.Collections.Generic" #> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class TimeOnlyConverter : ValueConverter<TimeOnly, TimeSpan> | |
{ | |
public TimeOnlyConverter() : base( | |
timeOnly => timeOnly.ToTimeSpan(), | |
timeSpan => TimeOnly.FromTimeSpan(timeSpan)) | |
{ | |
} | |
} | |
public class TimeOnlyComparer : ValueComparer<TimeOnly> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class DateOnlyConverter : ValueConverter<DateOnly, DateTime> | |
{ | |
public DateOnlyConverter() : base( | |
dateOnly => dateOnly.ToDateTime(TimeOnly.MinValue), | |
dateTime => DateOnly.FromDateTime(dateTime)) | |
{ | |
} | |
} | |
public class DateOnlyComparer : ValueComparer<DateOnly> |
NewerOlder