This file contains 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
{ | |
"$schema": "https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/main/themes/schema.json", | |
"blocks": [{ | |
"type": "prompt", | |
"alignment": "left", | |
"segments": [{ | |
"type": "root", | |
"style": "powerline", | |
"powerline_symbol": "\uE0B8", | |
"background": "#be8c00", |
This file contains 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
app.MapPost("/api/messenger", (Func<ContactModel, IMailService, IGoogleCaptchaService, string, Task<IActionResult>>) | |
(async ([FromBody] model, svc, captcha, template) => | |
{ | |
if (await captcha.Verify(model.Recaptcha)) | |
{ | |
if (await svc.SendMailAsync(template, model)) | |
{ | |
return new OkResult(); | |
} | |
} |
This file contains 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
<?xml version="1.0" encoding="utf-8"?> | |
<packages> | |
<package id="1password" version="7.9.822" /> | |
<package id="7zip" version="19.0" /> | |
<package id="7zip.install" version="19.0" /> | |
<package id="adobe-creative-cloud" /> | |
<package id="azure-functions-core-tools-3" version="3.0.3785" /> | |
<package id="chocolatey" /> | |
<package id="chocolateygui" /> | |
<package id="curl" version="7.79.1" /> |
This file contains 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; | |
namespace TroubleWithTuples | |
{ | |
public class Animal | |
{ | |
public (string Name, int Age) GetInfo() | |
{ | |
// return name and age | |
return ("Max", 16); |
This file contains 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; | |
using System.IO; | |
using System.Linq; | |
using static System.Console; | |
WriteLine("VSCleaner..."); | |
if (args.Length != 1) | |
{ | |
WriteLine("You must supply a directory name."); | |
WriteLine("VSCleaner {DirectoryName}"); |
This file contains 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
@echo off | |
echo Cleaning node_modules Directories | |
FOR /d /r . %%d IN (node_modules) DO (call :deleteDirs "%%d") | |
echo Cleaning bin Directories | |
FOR /d /r . %%d IN (bin) DO (call :deleteDirs "%%d") | |
echo Cleaning obj Directories | |
FOR /d /r . %%d IN (obj) DO (call :deleteDirs "%%d") | |
echo Cleaning .bak files | |
del /S *.bak | |
goto :eof |
This file contains 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
public class Program | |
{ | |
public static void Main(string[] args) | |
{ | |
CreateWebHostBuilder(args).Build().Run(); | |
} | |
public static IWebHostBuilder CreateWebHostBuilder(string[] args) => | |
WebHost.CreateDefaultBuilder(args) | |
.ConfigureLogging(ConfigLogging) |
This file contains 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
var result = someCollection | |
.Where(c => c.Married && c.Gender == Genders.Female) | |
.OrderBy(c => c.LastName) | |
.ForEach(c => | |
{ | |
c.LastName = $"{c.LastName}-{c.Partner.LastName}"; | |
}); |
This file contains 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
param ( | |
[string]$source = "d:\videoprojects\hwfilm\", | |
[string]$dest = "g:\hwfilm\", | |
[switch]$debug | |
) | |
$sourceFileList = Get-ChildItem -Path $source -Recurse | Sort-Object -Property FullName | |
write-host "Files = $($sourceFileList.Length)" | |
foreach ($file in $sourceFileList) { | |
$fullPath = $file.fullName.Substring($source.Length) |
This file contains 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; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
namespace SomeApp | |
{ | |
public class SomeStaticCollection : List<Person> | |
{ |
NewerOlder