Skip to content

Instantly share code, notes, and snippets.

View Arithmomaniac's full-sized avatar

Avi Levin Arithmomaniac

View GitHub Profile
# 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 ([email protected])
#
# 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.
@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;
}
@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 / 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 / with_common_parameters.yml
Created September 16, 2024 16:53
tsp-openapi3: common parameters not imported
openapi: 3.0.0
info:
title: (title)
version: 0.0.0
tags: []
paths:
/widgets/{id}:
get:
operationId: Widgets_read
responses: