Skip to content

Instantly share code, notes, and snippets.

View DanielMPries's full-sized avatar

Dan Pries DanielMPries

  • Buffalo, NY
View GitHub Profile
@DanielMPries
DanielMPries / is-json-schema.validator.ts
Last active December 21, 2024 02:42
NestJs JSON schema validator
import Ajv from 'ajv/dist/2020';
import {
ValidationArguments,
ValidatorConstraint,
ValidatorConstraintInterface,
ValidatorOptions,
registerDecorator,
} from 'class-validator';
@DanielMPries
DanielMPries / Program.cs
Last active February 1, 2023 17:09
Open Telemetry OLTP Collector
global using FastEndpoints;
using System.Reflection;
using FastEndpoints.Swagger;
using FluentMigrator.Runner;
using OpenTelemetry.Instrumentation.AspNetCore;
using Microsoft.Extensions.Caching.Distributed;
using Microsoft.Extensions.Caching.StackExchangeRedis;
using QuickI18N.API.Caching;
@DanielMPries
DanielMPries / .bash_aliases
Created December 26, 2019 16:06
Allows for dotnet_update_packages command
function read_solution() {
echo "Parsing solution $1"
while IFS='' read -r line || [[ -n "$line" ]]; do
if [[ $line =~ \"([^\"]*.csproj)\" ]]; then
project="${BASH_REMATCH[1]}"
read_project "$(echo "$project"|tr '\\' '/')"
fi
done < "$1"
@DanielMPries
DanielMPries / .bash_aliases
Created December 26, 2019 16:06
Allows for dotnet_update_packages command
function read_solution() {
echo "Parsing solution $1"
while IFS='' read -r line || [[ -n "$line" ]]; do
if [[ $line =~ \"([^\"]*.csproj)\" ]]; then
project="${BASH_REMATCH[1]}"
read_project "$(echo "$project"|tr '\\' '/')"
fi
done < "$1"
(New-Object System.DirectoryServices.DirectorySearcher("(&(objectCategory=User)(samAccountName=$($env:userna
me)))")).FindOne().GetDirectoryEntry().memberOf
@DanielMPries
DanielMPries / .editorconfig
Last active December 11, 2019 02:14
dotnet-format tool and task
root = true;
[*]
indent_style = space
trim_trailing_whitespace = true
end_of_line = lf
# Code files
[*.{cs,csx,vb,vbx}]
indent_size = 4
@DanielMPries
DanielMPries / XmlDocMd.ps1
Created December 11, 2019 02:11
Tool and task for Xml Doc Markdown
dotnet tool install xmldocmd -g
@DanielMPries
DanielMPries / CoverletDependencies.ps1
Last active December 11, 2019 02:16
Coverlet settings
# Add coverlet to the test project(s)
dotnet add package coverlet.msbuild
# or for VSTest
# dotnet add package coverlet.collector
# Add the coverlet global cli tool
dotnet tool install --global coverlet.console
# coverage gutters vscode extension
ext install ryanluker.vscode-coverage-gutters
@DanielMPries
DanielMPries / SpecflowDependencies.ps1
Created December 11, 2019 01:34
Specflow packages
dotnet add package Specflow
dotnet add package SpecFlow.MsTest
dotnet add package SpecFlow.Tools.MsBuild.Generation
dotnet add package FluentAssertions