Skip to content

Instantly share code, notes, and snippets.

@tmeckel
tmeckel / Read-DotEnv.ps1
Created June 10, 2022 16:21
Read .env file with PowerShell
[CmdletBinding(SupportsShouldProcess = $true)]
[OutputType([System.Object[]])]
param(
[Parameter(Position=0, ValueFromPipeline)]
[ValidateNotNullOrEmpty()]
[string]
$LiteralPath = (Join-Path -Path $PSScriptRoot -ChildPath '.env'),
[Parameter()]
[switch]
@jensmeder
jensmeder / Dockerfile
Last active August 6, 2025 18:02
Hello World Example For .NET 4.5.2 Running With Wine in Ubuntu Docker Container
FROM ubuntu:18.04
# Install wget
RUN apt-get update
RUN apt-get install -y wget
# Add 32-bit architecture
RUN dpkg --add-architecture i386
RUN apt-get update
public class RevalidatingAuthenticationStateProvider : AuthenticationStateProvider, IDisposable
{
private static TimeSpan RefreshInterval = TimeSpan.FromMinutes(30);
private readonly CancellationTokenSource _cts;
private ClaimsPrincipal _currentUser;
public RevalidatingAuthenticationStateProvider(SignInManager<IdentityUser> signInManager)
{
_cts = new CancellationTokenSource();
@kphillisjr
kphillisjr / QueryDotnet.js
Created August 22, 2018 23:47
JSCript.NET Working Examples
/*
To Compile:
PATH\\TO\\jsc.exe QueryDotnet.js
This example is based on:
https://docs.microsoft.com/en-us/dotnet/framework/migration-guide/how-to-determine-which-versions-are-installed
*/
import System;
import Microsoft.Win32;