Skip to content

Instantly share code, notes, and snippets.

@danielcrenna
danielcrenna / README.md
Last active July 23, 2020 09:00 — forked from fredeil/README.md
GitHub action for versioning your repository using NBGV

Simple versioning of your repository

Using NBGV to tag your master branch on push.

@danielcrenna
danielcrenna / PackagePrep.csproj
Last active November 21, 2019 17:10 — forked from attilah/X.Y.Z.Sources.csproj
X.Y.Z.Sources nuget package (with pre-processor transformations support)
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework>
</PropertyGroup>
</Project>
@danielcrenna
danielcrenna / Delta.cs
Created November 1, 2018 04:11 — forked from anonymous/Delta.cs
Simplified, single-class version of OData's Delta<T> built with FastMember
using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Linq;
using API.Infrastructure.Helpers.FastMember;
using ServiceStack;
namespace API.Infrastructure.Models
{
public class Delta<T> : DynamicObject where T : class
@danielcrenna
danielcrenna / BlockingCollectionExtensions.cs
Created October 31, 2018 22:09 — forked from georgiosd/BlockingCollectionExtensions.cs
Throttle items consumed from a BlockingCollection<T>
// Copyright (c) Georgios Diamantopoulos. All rights reserved.
// Licensed under the MIT license. See LICENSE in this gist for full license information.
// The Throttle class is the RateGate class published here http://www.jackleitch.com/2010/10/better-rate-limiting-with-dot-net/, renamed and copied for convenience.
public static class BlockingCollectionExtensions
{
// TODO: devise a way to avoid problems if collection gets too big (produced faster than consumed)
public static IObservable<T> AsRateLimitedObservable<T>(this BlockingCollection<T> sequence, int items, TimeSpan timePeriod, CancellationToken producerToken)
{
Subject<T> subject = new Subject<T>();