Skip to content

Instantly share code, notes, and snippets.

View DevPoint's full-sized avatar

Wilfried Reiter DevPoint

View GitHub Profile
@DevPoint
DevPoint / FieldIdentifierHelper.cs
Last active February 5, 2025 15:33
This method parses property paths like 'SomeProp.MyCollection[123].ChildProp' and returns a FieldIdentifier for use in Blazor ValidationMessageStore.
using System;
using System.Collections.Generic;
using System.Reflection;
using Microsoft.AspNetCore.Components.Forms;
namespace Bookin.Web.Elements
{
public static class FieldIdentifierHelper
{
private readonly static char[] Separators = ['.', '['];
@DevPoint
DevPoint / .htaccess
Last active September 21, 2024 07:05
Blazor WebAssembly App - htaccess für Apache
<IfModule mod_rewrite.c>
## Serve precompressed Brotli files if they exist.
## Adapted from <https://stackoverflow.com/questions/46487635/how-to-serve-precompressed-gzip-brotli-files-with-htaccess>
## Make sure `RewriteBase /` is present somewhere in your .htaccess file.
# If the web browser accepts Brotli encoding...
RewriteCond %{HTTP:Accept-encoding} br
# ...and the web browser is fetching a probably pre-compressed file...
RewriteCond %{REQUEST_URI} .*\.(css|dat|html|js|json|svg|wasm)
# ...and a matching pre-compressed file exists...
RewriteCond %{REQUEST_FILENAME}.br -s
@DevPoint
DevPoint / CsvReader.cs
Last active October 2, 2024 11:02
C# implementation of a CSV reader which generates a two dimensional cells array of strings out of an CSV file
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Threading.Tasks;
namespace Devpoint
{
public class CsvReader
{