Mirror of
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

basic setup

trueberryless cbc776de

+325
+25
.dockerignore
··· 1 + **/.dockerignore 2 + **/.env 3 + **/.git 4 + **/.gitignore 5 + **/.project 6 + **/.settings 7 + **/.toolstarget 8 + **/.vs 9 + **/.vscode 10 + **/.idea 11 + **/*.*proj.user 12 + **/*.dbmdl 13 + **/*.jfm 14 + **/azds.yaml 15 + **/bin 16 + **/charts 17 + **/docker-compose* 18 + **/Dockerfile* 19 + **/node_modules 20 + **/npm-debug.log 21 + **/obj 22 + **/secrets.dev.yaml 23 + **/values.dev.yaml 24 + LICENSE 25 + README.md
+5
.gitignore
··· 1 + bin/ 2 + obj/ 3 + /packages/ 4 + riderModule.iml 5 + /_ReSharper.Caches/
+13
.idea/.idea.ReleaseImageGenerator/.idea/.gitignore
··· 1 + # Default ignored files 2 + /shelf/ 3 + /workspace.xml 4 + # Rider ignored files 5 + /contentModel.xml 6 + /projectSettingsUpdater.xml 7 + /modules.xml 8 + /.idea.ReleaseImageGenerator.iml 9 + # Editor-based HTTP Client requests 10 + /httpRequests/ 11 + # Datasource local storage ignored files 12 + /dataSources/ 13 + /dataSources.local.xml
+4
.idea/.idea.ReleaseImageGenerator/.idea/encodings.xml
··· 1 + <?xml version="1.0" encoding="UTF-8"?> 2 + <project version="4"> 3 + <component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" /> 4 + </project>
+8
.idea/.idea.ReleaseImageGenerator/.idea/indexLayout.xml
··· 1 + <?xml version="1.0" encoding="UTF-8"?> 2 + <project version="4"> 3 + <component name="UserContentModel"> 4 + <attachedFolders /> 5 + <explicitIncludes /> 6 + <explicitExcludes /> 7 + </component> 8 + </project>
+6
.idea/.idea.ReleaseImageGenerator/.idea/vcs.xml
··· 1 + <?xml version="1.0" encoding="UTF-8"?> 2 + <project version="4"> 3 + <component name="VcsDirectoryMappings"> 4 + <mapping directory="$PROJECT_DIR$" vcs="Git" /> 5 + </component> 6 + </project>
+23
ReleaseImageGenerator.API/Dockerfile
··· 1 + FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base 2 + USER $APP_UID 3 + WORKDIR /app 4 + EXPOSE 8080 5 + EXPOSE 8081 6 + 7 + FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build 8 + ARG BUILD_CONFIGURATION=Release 9 + WORKDIR /src 10 + COPY ["ReleaseImageGenerator/ReleaseImageGenerator.csproj", "ReleaseImageGenerator/"] 11 + RUN dotnet restore "ReleaseImageGenerator/ReleaseImageGenerator.csproj" 12 + COPY . . 13 + WORKDIR "/src/ReleaseImageGenerator" 14 + RUN dotnet build "ReleaseImageGenerator.csproj" -c $BUILD_CONFIGURATION -o /app/build 15 + 16 + FROM build AS publish 17 + ARG BUILD_CONFIGURATION=Release 18 + RUN dotnet publish "ReleaseImageGenerator.csproj" -c $BUILD_CONFIGURATION -o /app/publish /p:UseAppHost=false 19 + 20 + FROM base AS final 21 + WORKDIR /app 22 + COPY --from=publish /app/publish . 23 + ENTRYPOINT ["dotnet", "ReleaseImageGenerator.dll"]
+138
ReleaseImageGenerator.API/Program.cs
··· 1 + using SkiaSharp; 2 + 3 + var builder = WebApplication.CreateBuilder(args); 4 + 5 + // Add services to the container. 6 + // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle 7 + builder.Services.AddEndpointsApiExplorer(); 8 + builder.Services.AddSwaggerGen(); 9 + 10 + var app = builder.Build(); 11 + 12 + // Configure the HTTP request pipeline. 13 + if (app.Environment.IsDevelopment()) 14 + { 15 + app.UseSwagger(); 16 + app.UseSwaggerUI(); 17 + } 18 + 19 + app.UseHttpsRedirection(); 20 + 21 + app.MapGet("/image-generator", (string text) => 22 + { 23 + text = string.IsNullOrEmpty(text) ? "Release 1.0" : text; 24 + 25 + int width = 1200; 26 + int height = 600; 27 + 28 + using var surface = SKSurface.Create(new SKImageInfo(width, height)); 29 + var canvas = surface.Canvas; 30 + 31 + // Fill with a random gradient background 32 + var random = new Random(); 33 + var paint = new SKPaint 34 + { 35 + Shader = SKShader.CreateLinearGradient( 36 + new SKPoint(0, 0), 37 + new SKPoint(width, height), 38 + new SKColor[] { 39 + RandomColor(random), 40 + RandomColor(random), 41 + RandomColor(random) 42 + }, 43 + SKShaderTileMode.Clamp 44 + ) 45 + }; 46 + canvas.DrawRect(0, 0, width, height, paint); 47 + 48 + // Add some noise 49 + AddNoise(canvas, width, height); 50 + 51 + // Draw a simple pattern 52 + // DrawPattern(canvas, width, height); 53 + 54 + // Load JetBrains Mono font 55 + var typeface = SKTypeface.FromFile("./fonts/JetBrainsMono-Bold.ttf"); 56 + 57 + // Calculate text size and position 58 + paint = new SKPaint 59 + { 60 + Color = SKColors.White, 61 + TextSize = 100, 62 + IsAntialias = true, 63 + Typeface = typeface ?? SKTypeface.Default 64 + }; 65 + 66 + var textWidth = paint.MeasureText(text); 67 + var textBounds = new SKRect(); 68 + paint.MeasureText(text, ref textBounds); 69 + 70 + float textX = (width - textWidth) / 2; 71 + float textY = height / 2 + textBounds.Height / 2; 72 + 73 + // Draw glassmorphism background 74 + var bgPaint = new SKPaint 75 + { 76 + Color = SKColors.White.WithAlpha(40), 77 + IsAntialias = true 78 + }; 79 + var borderPaint = new SKPaint 80 + { 81 + Color = SKColors.White.WithAlpha(100), 82 + IsStroke = true, 83 + StrokeWidth = 4, 84 + IsAntialias = true 85 + }; 86 + 87 + var padding = 40; 88 + var rect = new SKRect(textX - padding, textY + textBounds.Top - padding, textX + textWidth + padding, textY + padding); 89 + canvas.DrawRoundRect(rect, 20, 20, bgPaint); 90 + canvas.DrawRoundRect(rect, 20, 20, borderPaint); 91 + 92 + // Draw the text 93 + canvas.DrawText(text, textX, textY, paint); 94 + 95 + // Return as JPEG 96 + var stream = new MemoryStream(); 97 + using var image = surface.Snapshot(); 98 + using var data = image.Encode(SKEncodedImageFormat.Jpeg, 90); 99 + data.SaveTo(stream); 100 + return Results.File(stream.ToArray(), "image/jpeg"); 101 + }) 102 + .WithName("ImageGenerator") 103 + .WithOpenApi(); 104 + 105 + app.Run(); 106 + 107 + static SKColor RandomColor(Random random) 108 + { 109 + return new SKColor( 110 + (byte)random.Next(256), 111 + (byte)random.Next(256), 112 + (byte)random.Next(256) 113 + ); 114 + } 115 + 116 + static void AddNoise(SKCanvas canvas, int width, int height) 117 + { 118 + var random = new Random(); 119 + var noisePaint = new SKPaint { Color = SKColors.White.WithAlpha(10) }; 120 + for (int i = 0; i < 1000; i++) 121 + { 122 + canvas.DrawPoint(random.Next(width), random.Next(height), noisePaint); 123 + } 124 + } 125 + 126 + static void DrawPattern(SKCanvas canvas, int width, int height) 127 + { 128 + var paint = new SKPaint 129 + { 130 + Color = SKColors.White.WithAlpha(20), 131 + StrokeWidth = 2 132 + }; 133 + 134 + for (int i = 0; i < width; i += 40) 135 + { 136 + canvas.DrawLine(i, 0, i, height, paint); 137 + } 138 + }
+41
ReleaseImageGenerator.API/Properties/launchSettings.json
··· 1 + { 2 + "$schema": "http://json.schemastore.org/launchsettings.json", 3 + "iisSettings": { 4 + "windowsAuthentication": false, 5 + "anonymousAuthentication": true, 6 + "iisExpress": { 7 + "applicationUrl": "http://localhost:58033", 8 + "sslPort": 44331 9 + } 10 + }, 11 + "profiles": { 12 + "http": { 13 + "commandName": "Project", 14 + "dotnetRunMessages": true, 15 + "launchBrowser": true, 16 + "launchUrl": "swagger", 17 + "applicationUrl": "http://localhost:5033", 18 + "environmentVariables": { 19 + "ASPNETCORE_ENVIRONMENT": "Development" 20 + } 21 + }, 22 + "https": { 23 + "commandName": "Project", 24 + "dotnetRunMessages": true, 25 + "launchBrowser": true, 26 + "launchUrl": "swagger", 27 + "applicationUrl": "https://localhost:7023;http://localhost:5033", 28 + "environmentVariables": { 29 + "ASPNETCORE_ENVIRONMENT": "Development" 30 + } 31 + }, 32 + "IIS Express": { 33 + "commandName": "IISExpress", 34 + "launchBrowser": true, 35 + "launchUrl": "swagger", 36 + "environmentVariables": { 37 + "ASPNETCORE_ENVIRONMENT": "Development" 38 + } 39 + } 40 + } 41 + }
+23
ReleaseImageGenerator.API/ReleaseImageGenerator.API.csproj
··· 1 + <Project Sdk="Microsoft.NET.Sdk.Web"> 2 + 3 + <PropertyGroup> 4 + <TargetFramework>net8.0</TargetFramework> 5 + <Nullable>enable</Nullable> 6 + <ImplicitUsings>enable</ImplicitUsings> 7 + <DockerDefaultTargetOS>Linux</DockerDefaultTargetOS> 8 + <RootNamespace>ReleaseImageGenerator</RootNamespace> 9 + </PropertyGroup> 10 + 11 + <ItemGroup> 12 + <PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.12"/> 13 + <PackageReference Include="SkiaSharp" Version="3.116.1" /> 14 + <PackageReference Include="Swashbuckle.AspNetCore" Version="6.6.2"/> 15 + </ItemGroup> 16 + 17 + <ItemGroup> 18 + <Content Include="..\.dockerignore"> 19 + <Link>.dockerignore</Link> 20 + </Content> 21 + </ItemGroup> 22 + 23 + </Project>
+6
ReleaseImageGenerator.API/ReleaseImageGenerator.http
··· 1 + @ReleaseImageGenerator_HostAddress = http://localhost:5033 2 + 3 + GET {{ReleaseImageGenerator_HostAddress}}/weatherforecast/ 4 + Accept: application/json 5 + 6 + ###
+8
ReleaseImageGenerator.API/appsettings.Development.json
··· 1 + { 2 + "Logging": { 3 + "LogLevel": { 4 + "Default": "Information", 5 + "Microsoft.AspNetCore": "Warning" 6 + } 7 + } 8 + }
+9
ReleaseImageGenerator.API/appsettings.json
··· 1 + { 2 + "Logging": { 3 + "LogLevel": { 4 + "Default": "Information", 5 + "Microsoft.AspNetCore": "Warning" 6 + } 7 + }, 8 + "AllowedHosts": "*" 9 + }
ReleaseImageGenerator.API/fonts/JetBrainsMono-Bold.ttf

This is a binary file and will not be displayed.

ReleaseImageGenerator.API/fonts/JetBrainsMono-BoldItalic.ttf

This is a binary file and will not be displayed.

ReleaseImageGenerator.API/fonts/JetBrainsMono-ExtraBold.ttf

This is a binary file and will not be displayed.

ReleaseImageGenerator.API/fonts/JetBrainsMono-ExtraBoldItalic.ttf

This is a binary file and will not be displayed.

ReleaseImageGenerator.API/fonts/JetBrainsMono-ExtraLight.ttf

This is a binary file and will not be displayed.

ReleaseImageGenerator.API/fonts/JetBrainsMono-ExtraLightItalic.ttf

This is a binary file and will not be displayed.

ReleaseImageGenerator.API/fonts/JetBrainsMono-Italic.ttf

This is a binary file and will not be displayed.

ReleaseImageGenerator.API/fonts/JetBrainsMono-Light.ttf

This is a binary file and will not be displayed.

ReleaseImageGenerator.API/fonts/JetBrainsMono-LightItalic.ttf

This is a binary file and will not be displayed.

ReleaseImageGenerator.API/fonts/JetBrainsMono-Medium.ttf

This is a binary file and will not be displayed.

ReleaseImageGenerator.API/fonts/JetBrainsMono-MediumItalic.ttf

This is a binary file and will not be displayed.

ReleaseImageGenerator.API/fonts/JetBrainsMono-Regular.ttf

This is a binary file and will not be displayed.

ReleaseImageGenerator.API/fonts/JetBrainsMono-SemiBold.ttf

This is a binary file and will not be displayed.

ReleaseImageGenerator.API/fonts/JetBrainsMono-SemiBoldItalic.ttf

This is a binary file and will not be displayed.

ReleaseImageGenerator.API/fonts/JetBrainsMono-Thin.ttf

This is a binary file and will not be displayed.

ReleaseImageGenerator.API/fonts/JetBrainsMono-ThinItalic.ttf

This is a binary file and will not be displayed.

ReleaseImageGenerator.API/fonts/JetBrainsMonoNL-Bold.ttf

This is a binary file and will not be displayed.

ReleaseImageGenerator.API/fonts/JetBrainsMonoNL-BoldItalic.ttf

This is a binary file and will not be displayed.

ReleaseImageGenerator.API/fonts/JetBrainsMonoNL-ExtraBold.ttf

This is a binary file and will not be displayed.

ReleaseImageGenerator.API/fonts/JetBrainsMonoNL-ExtraBoldItalic.ttf

This is a binary file and will not be displayed.

ReleaseImageGenerator.API/fonts/JetBrainsMonoNL-ExtraLight.ttf

This is a binary file and will not be displayed.

ReleaseImageGenerator.API/fonts/JetBrainsMonoNL-ExtraLightItalic.ttf

This is a binary file and will not be displayed.

ReleaseImageGenerator.API/fonts/JetBrainsMonoNL-Italic.ttf

This is a binary file and will not be displayed.

ReleaseImageGenerator.API/fonts/JetBrainsMonoNL-Light.ttf

This is a binary file and will not be displayed.

ReleaseImageGenerator.API/fonts/JetBrainsMonoNL-LightItalic.ttf

This is a binary file and will not be displayed.

ReleaseImageGenerator.API/fonts/JetBrainsMonoNL-Medium.ttf

This is a binary file and will not be displayed.

ReleaseImageGenerator.API/fonts/JetBrainsMonoNL-MediumItalic.ttf

This is a binary file and will not be displayed.

ReleaseImageGenerator.API/fonts/JetBrainsMonoNL-Regular.ttf

This is a binary file and will not be displayed.

ReleaseImageGenerator.API/fonts/JetBrainsMonoNL-SemiBold.ttf

This is a binary file and will not be displayed.

ReleaseImageGenerator.API/fonts/JetBrainsMonoNL-SemiBoldItalic.ttf

This is a binary file and will not be displayed.

ReleaseImageGenerator.API/fonts/JetBrainsMonoNL-Thin.ttf

This is a binary file and will not be displayed.

ReleaseImageGenerator.API/fonts/JetBrainsMonoNL-ThinItalic.ttf

This is a binary file and will not be displayed.

+16
ReleaseImageGenerator.sln
··· 1 +  2 + Microsoft Visual Studio Solution File, Format Version 12.00 3 + Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ReleaseImageGenerator.API", "ReleaseImageGenerator.API\ReleaseImageGenerator.API.csproj", "{6DAC702E-2CFB-41BA-813E-8352C60203AE}" 4 + EndProject 5 + Global 6 + GlobalSection(SolutionConfigurationPlatforms) = preSolution 7 + Debug|Any CPU = Debug|Any CPU 8 + Release|Any CPU = Release|Any CPU 9 + EndGlobalSection 10 + GlobalSection(ProjectConfigurationPlatforms) = postSolution 11 + {6DAC702E-2CFB-41BA-813E-8352C60203AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 12 + {6DAC702E-2CFB-41BA-813E-8352C60203AE}.Debug|Any CPU.Build.0 = Debug|Any CPU 13 + {6DAC702E-2CFB-41BA-813E-8352C60203AE}.Release|Any CPU.ActiveCfg = Release|Any CPU 14 + {6DAC702E-2CFB-41BA-813E-8352C60203AE}.Release|Any CPU.Build.0 = Release|Any CPU 15 + EndGlobalSection 16 + EndGlobal