This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# winget install JanDeDobbeleer.OhMyPosh -s winget | |
# https://ohmyposh.dev/docs/installation/customize | |
oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH/unicorn.omp.json" | Invoke-Expression | |
# Install-Module -Name PSFzf | |
# https://github.com/kelleyma49/PSFzf/tree/master?tab=readme-ov-file#psfzf | |
Set-PsFzfOption -PSReadlineChordProvider 'Ctrl+t' -PSReadlineChordReverseHistory 'Ctrl+r' | |
# choco install zoxide -y | |
Invoke-Expression (& { (zoxide init powershell | Out-String) }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Threading.Channels; | |
var builder = Host.CreateApplicationBuilder(args); | |
builder.Services.AddHostedService<Worker>(); | |
builder.Services.AddSingleton<SettingsQueue>(); | |
var host = builder.Build(); | |
var writer = host.Services.GetRequiredService<SettingsQueue>().Settings.Writer; | |
writer.TryWrite(true); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
When `LogOperation1` logs the exception, the log record does not contain the properties | |
of the logging scope that were active at the moment of throwing. | |
`LogOperation2` has no such issue. | |
Demo: | |
❯ dotnet run | grep '^{' | jq 'del(.["@t"], .["@i"], .["@l"], .["@x"], .SourceContext)' | |
{ | |
"@m": "Starting operation: \"Fail1\"", | |
"OperationName": "Fail1" | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
whoami |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let inline fromStr< ^T when ^T : enum<int32> and ^T : equality >(s: string) : Option< ^T > = | |
let t = typeof<'T> | |
let enumStrings = System.Enum.GetNames(t) | |
let vals = System.Enum.GetValues(t) :?> 'T[] | |
Array.zip vals enumStrings | |
|> Array.tryFind (fun (x, s') -> s' = s) | |
|> Option.map fst | |
let inline toStr< ^T when ^T : enum<int32> and ^T : equality >(x: ^T) = | |
let t = typeof<'T> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(* | |
You are given a string s that consists of English letters, punctuation marks, | |
whitespace characters and brackets. | |
It is guaranteed that the brackets in s form a regular bracket sequence. | |
Your task is to reverse the strings in each pair of matching parenthesis, | |
starting from the innermost one. | |
Example | |
For string "s = a(bc)de" the output should be |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma warning disable 1591 | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Linq.Expressions; | |
using System.Threading.Tasks; | |
using DomainDbHelpers.Domain; | |
using DomainDbHelpers.DomainHelpers; | |
using DomainDbHelpers.Persistence; | |
using DomainDbHelpers.PersistenceHelpers; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace TestUtils | |
/// An unbounded pool of browsers. | |
module BrowserPool = | |
open System | |
open OpenQA.Selenium.Chrome | |
open System.Collections.Concurrent | |
let private pool = ConcurrentQueue<ChromeDriver>() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.NOTES | |
Licensed under WTFPL, Version 2. | |
.SYNOPSIS | |
Extracts the DB-schema from the latest EF migration in the specified database. | |
.DESCRIPTION | |
Writes the extracted schema to the output file in the EDMX format. | |
The "(local)" server is used. | |
.PARAMETER Database | |
The database with EF migrations (in the __MigrationHistory table). |
NewerOlder