Skip to content

Instantly share code, notes, and snippets.

View Arithmomaniac's full-sized avatar

Avi Levin Arithmomaniac

View GitHub Profile
@Arithmomaniac
Arithmomaniac / AsyncChannelPresentation_Public.dib
Created August 9, 2023 06:57
Presentation - Data Flows with Async Streams and Channels
#!meta
{"kernelInfo":{"defaultKernelName":"csharp","items":[{"aliases":[],"languageName":"csharp","name":"csharp"}]}}
#!markdown
# Data Flows with Async Streams and Channels
Avi Levin (@Arithmomaniac)<br>
2023-07-30
@Arithmomaniac
Arithmomaniac / AsyncEnumeratorStream.linq
Last active October 20, 2022 08:43
Stream from async byte enumerator
<Query Kind="Statements" />
using System;
using System.Buffers;
using System.Diagnostics;
using System.Threading;
using System.Threading.Tasks;
// based on https://github.com/dotnet/runtime/blob/main/src/libraries/System.IO.Pipelines/src/System/IO/Pipelines/PipeReaderStream.cs
@Arithmomaniac
Arithmomaniac / GroupBatch.cs
Created August 8, 2017 21:47
GroupBatch naive implementation
public static class GroupBatchExtension
{
/// <summary>A simple IGrouping implementation used by GroupBatch.</summary>
private class GroupBatchGrouping<TKey, TElement> : List<TElement>, IGrouping<TKey, TElement>
{
public GroupBatchGrouping(int rank, TKey key, IEnumerable<TElement> values):base(values)
{
Key = key;
Rank = rank;
}
# The following is from https://blogs.technet.microsoft.com/pauljones/2014/01/09/backing-up-a-file-system-to-azure-storage-with-powershell-2/
# This script was written by Kevin Saye (ksaye@saye.org)
#
# This is a Powershell backup script that backs up entire directories to Azure Storage
# to get the Azure Powershell modules, you must install the following commandlets:
# http://www.windowsazure.com/en-us/manage/install-and-configure-windows-powershell/
# A special thanks to http://www.nikgupta.net/2013/09/azure-blob-storage-powershell/ for the tips!
#
# I am assuming you have one container for each machine you are backing up.