I hereby claim:
- I am flq on github.
- I am fquednau (https://keybase.io/fquednau) on keybase.
- I have a public key ASDraf_OUnnhDWmgwKEoWTSV7QHQ1pjDPm0pCCSGME0ttwo
To claim this, I am signing this object:
#nullable enable | |
using System; | |
using System.Collections.Generic; | |
using System.IO; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace Utilities; | |
public class AsyncEnumerableStream(IAsyncEnumerable<byte[]> source) : Stream |
using System; | |
using System.Linq; | |
using System.Reflection; | |
using Microsoft.Extensions.DependencyInjection; | |
namespace DIPlaygroundWebApp.ServiceCollectionInfrastructure | |
{ | |
public static class AssemblyPoolRegistrar | |
{ | |
public static AssembliesForRegistration UseBulkRegistration(this IServiceCollection svcCollection, |
.NET snippets | |
1. Deconstruct a regex match group collection |
using System; | |
using System.Runtime.Remoting.Proxies; | |
internal class Program | |
{ | |
private static void Main(string[] args) | |
{ | |
var c = new CrazyObject(); | |
Console.WriteLine(c.Hello()); | |
Console.ReadLine(); | |
} |
function indent([parameter(ValueFromPipeline)]$Content) | |
{ | |
$StringWriter = New-Object System.IO.StringWriter | |
$XmlWriter = New-Object System.XMl.XmlTextWriter $StringWriter | |
$xmlWriter.Formatting = "indented" | |
$xmlWriter.Indentation = 2 | |
$Content.WriteContentTo($XmlWriter) | |
$XmlWriter.Flush() | |
$StringWriter.Flush() | |
Write-Output $StringWriter.ToString() |
module BitempTests | |
type TimePoint<'S> = { | |
recorded : int; | |
actual : int; | |
state : 'S; | |
} | |
type HistoryEntry<'S> = { | |
time : int; |
I hereby claim:
To claim this, I am signing this object:
using System.Collections.Generic; | |
using Xunit; | |
using static NMeasure.U; | |
using static NMeasure.Tests.IiUnits; | |
namespace NMeasure.Tests | |
{ | |
public class IIUnitsTests | |
{ | |
public IIUnitsTests() |
import {assign} from 'lodash' | |
function startModule() { | |
//etc. | |
} | |
global['Project'] = assign(global['Project'] || {}, { | |
startModule | |
}); |
module Permutation where | |
permutate :: [a] -> [[a]] | |
permutate [x1,x2] = [[x1,x2],[x2,x1]] | |
permutate items = concat $ map p $ getEachInFrontOnce items | |
where | |
p (x:xs) = map (\items -> [x]++items) $ permutate xs | |
getEachInFrontOnce items = map (putItemAtIndexToFront items) [0..length items-1] | |
putItemAtIndexToFront items idx = [items!!idx] ++ take idx items ++ drop (idx+1) items |