await Cli.Wrap("docker")
.WithArguments("run --detach -e POSTGRES_PASSWORD=password postgres")
.ExecuteAsync();
- Show contents of command result
- Show how to get process ID
// * Summary *
BenchmarkDotNet=v0.13.1, OS=Windows 10.0.19043.1348 (21H1/May2021Update) 11th Gen Intel Core i5-11600K 3.90GHz, 1 CPU, 12 logical and 6 physical cores .NET SDK=6.0.100 [Host] : .NET 6.0.0 (6.0.21.52210), X64 RyuJIT DefaultJob : .NET 6.0.0 (6.0.21.52210), X64 RyuJIT
| Method | Mean | Error | StdDev | Ratio | RatioSD | Allocated |
// Likes all tweets on the screen | |
// Copy the lines below and add them as a bookmark | |
javascript: (() => { | |
const processedTweetIds = new Set(); | |
const parseTweet = (el) => { | |
const id = [...el.querySelectorAll("a[href]")] | |
.map((a) => a.href) | |
.find((href) => href.includes("/status/")) | |
.split("/") |
$profileDirPath = New-TemporaryFile | %{ Remove-Item $_; New-Item -ItemType Directory $_ } | |
Start-Process "c:/Program Files/Google/Chrome/Application/chrome" -ArgumentList "--user-data-dir=$profileDirPath" -Wait | |
Remove-Item $profileDirPath -Recurse -Force |
// Algorithm taken from http://tannerhelland.com/4435/convert-temperature-rgb-algorithm-code | |
private static double GetRed(double temperature) | |
{ | |
if (temperature > 6600) | |
{ | |
return Math.Clamp( | |
Math.Pow(temperature / 100 - 60, -0.1332047592) * 329.698727446 / 255, | |
0, 1 | |
); |
internal partial class ResizableSemaphore : IDisposable | |
{ | |
private readonly object _lock = new(); | |
private readonly Queue<TaskCompletionSource> _waiters = new(); | |
private readonly CancellationTokenSource _cts = new(); | |
private bool _isDisposed; | |
private int _maxCount = int.MaxValue; | |
private int _count; |
gh auth login --web | |
$owner = "" # leave empty for current user | |
$repos = gh repo list $owner --fork --json nameWithOwner | ConvertFrom-Json | |
foreach ($repo in $repos) { | |
$repoName = $repo.nameWithOwner | |
Write-Host "Deleting repository: $repoName..." | |
Read-Host -Prompt "Press ENTER to confirm..." |
gh auth login --web | |
$repo = "" # set repo here | |
$author = "" # set author here | |
$issues = gh issue list --repo $repo --author $author --limit 1000 --json number,author,title | ConvertFrom-Json | |
foreach ($issue in $issues) { | |
$issueNumber = $issue.number | |
$issueAuthor = $issue.author.login |