Run this script from GitHub Gist directly
npx https://gist.github.com/akunzai/e245cb079d90bf102b8a7bf60ef07536
using System.Reflection; | |
namespace System.Text.Json.Serialization; | |
/// https://learn.microsoft.com/dotnet/standard/serialization/system-text-json/converters-how-to | |
public class ListOfEnumStringConverter : JsonConverterFactory | |
{ | |
public override bool CanConvert(Type typeToConvert) | |
{ | |
if (!typeToConvert.IsGenericType) |
Run this script from GitHub Gist directly
npx https://gist.github.com/akunzai/e245cb079d90bf102b8a7bf60ef07536
#! /usr/bin/env python3 | |
# encoding: utf-8 | |
""" | |
This is a small python script to clear up old gitlab build artifacts. | |
""" | |
import argparse | |
import datetime | |
import functools | |
import json |
#!/bin/sh | |
# Origin: https://github.com/inderpreet99/protoaculous-bundler | |
# Requirements: curl,unzip,perl,npx | |
PROTOTYPE_VER="1.7.3.0" | |
SCRIPTACULOUS_VER="1.9.0" | |
[ -f "prototype.$PROTOTYPE_VER.js" ] || curl -so prototype.$PROTOTYPE_VER.js https://ajax.googleapis.com/ajax/libs/prototype/$PROTOTYPE_VER/prototype.js | |
[ -f "scriptaculous-js-$SCRIPTACULOUS_VER.zip" ] || curl -sO http://script.aculo.us/dist/scriptaculous-js-$SCRIPTACULOUS_VER.zip | |
unzip -q -o scriptaculous-js-$SCRIPTACULOUS_VER.zip |
<!-- The following configuration should also work with Azure App Service --> | |
<configuration> | |
<system.web> | |
<!-- Disable X-AspNet-Version Header --> | |
<httpRuntime enableVersionHeader="false" /> | |
<!-- File upload size limit (KB), avoid DoS attack --> | |
<httpRuntime maxRequestLength="4096" /> | |
<!-- Disable debug & trace in Production --> | |
<compilation debug="false" /> | |
<trace enabled="false" /> |
using System; | |
using System.Collections.Generic; | |
using System.Reflection; | |
using Microsoft.AspNetCore.Http; | |
public class MiddlewareDiagnosticObserver : IObserver<KeyValuePair<string,object?>> | |
{ | |
public void OnCompleted() | |
{ | |
// Do nothing |
{ | |
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json", | |
"blocks": [ | |
{ | |
"alignment": "left", | |
"segments": [ | |
{ | |
"style": "plain", | |
"template": " NET {{ .Full }}", | |
"type": "dotnet" |
using System.Buffers; | |
using System.Buffers.Text; | |
using System.Globalization; | |
using System.Reflection; | |
using System.Text.RegularExpressions; | |
namespace System.Text.Json.Serialization | |
{ | |
// https://github.com/dotnet/runtime/issues/30776 | |
public class MicrosoftDateTimeJsonConverter : JsonConverterFactory |
#if NETSTANDARD2_1 | |
using System.Buffers; | |
#else | |
using System.IO; | |
#endif | |
using System.Linq; | |
namespace System.Text.Json | |
{ | |
public static class JsonExtensions |
using System; | |
using System.IO; | |
using System.Text.Json; | |
using System.Threading.Tasks; | |
namespace Microsoft.Extensions.Caching.Distributed | |
{ | |
public static class DistributedCacheExtensions | |
{ | |
public static async Task<T> GetOrCreateAsync<T>(this IDistributedCache cache, |