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.Diagnostics; | |
| using System.Net.Sockets; | |
| using System.Security.Authentication; | |
| using Yarp.Telemetry.Consumption; | |
| var builder = WebApplication.CreateBuilder(args); | |
| builder.Services.AddTelemetryConsumer<TelemetryConsumer>(); | |
| var app = builder.Build(); |
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
| // Port of the C# 101 LINQ Samples rewritten into Apple's Swift 3. | |
| #![feature(ordering_chaining, step_by)] | |
| fn main() { | |
| // linq5: Where - Indexed | |
| /* | |
| //c# | |
| public void Linq5() | |
| { |
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
| function join($path) | |
| { | |
| $files = Get-ChildItem -Path "$path.*.part" | Sort-Object -Property @{Expression={ | |
| $shortName = [System.IO.Path]::GetFileNameWithoutExtension($_.Name) | |
| $extension = [System.IO.Path]::GetExtension($shortName) | |
| if ($extension -ne $null -and $extension -ne '') | |
| { | |
| $extension = $extension.Substring(1) | |
| } | |
| [System.Convert]::ToInt32($extension) |
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
| // Usage: myCollection.Page(pageNumber, pageSize); | |
| public static class IEnumerableExtension { | |
| public static IEnumerable<T> Page<T>(this IList<T> source, int pageNumber, int pageSize) | |
| { | |
| return source.Skip((pageNumber - 1) * pageSize).Take(pageSize); | |
| } | |
| } |
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
| void Main() | |
| { | |
| var actions = new[] | |
| { | |
| new TimedAction("first", () => | |
| { | |
| // Insert logic here. | |
| }), | |
| new TimedAction("second", () => | |
| { |