Skip to content

Instantly share code, notes, and snippets.

Avatar

Jordan Saladressing

View GitHub Profile
@Saladressing
Saladressing / AnonymousSessionMiddleware.cs
Created Mar 29, 2019
SampleAnonymousSessionMiddleware
View AnonymousSessionMiddleware.cs
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Authentication;
using System.Security.Claims;
public class AnonymousSessionMiddleware
{
private readonly RequestDelegate _next;
public AnonymousSessionMiddleware(RequestDelegate next)
{
@Saladressing
Saladressing / gist:fd25ba199777bb9f497e98ec03bc88b0
Last active Nov 1, 2018
BackgroundService Example in NET core
View gist:fd25ba199777bb9f497e98ec03bc88b0
// TestBackgroundService.cs
public class TestBackgroundService : BackgroundService, IHostedService
{
private readonly ILogger _logger;
public TestBackgroundService(ILogger<TestBackgroundService> logger)
{
_logger = logger;
}
View gist:36476db10b502d4dbc2c3fb2b56fe53a
var stats = {"updatedAt":1474997057,"packages":{"asset":{"releasedAt":"2015-02-10","total":548249,"perDay":1523.5,"perSecond":0.017633101851852},"assetic-bundle":{"releasedAt":"2012-04-13","total":11071584,"perDay":13492.7,"perSecond":0.15616550925926},"browser-kit":{"releasedAt":"2012-04-13","total":11119615,"perDay":15034.1,"perSecond":0.17400578703704},"cache":{"releasedAt":"2016-01-19","total":71133,"perDay":648.6,"perSecond":0.0075069444444444},"class-loader":{"releasedAt":"2012-04-13","total":5975899,"perDay":13641.066666667,"perSecond":0.15788271604938},"config":{"releasedAt":"2012-04-13","total":11601093,"perDay":22491.4,"perSecond":0.26031712962963},"console":{"releasedAt":"2012-04-13","total":31908522,"perDay":62525.766666667,"perSecond":0.72367785493827},"css-selector":{"releasedAt":"2012-04-13","total":17984302,"perDay":36953.866666667,"perSecond":0.42770679012346},"debug":{"releasedAt":"2013-04-07","total":19754360,"perDay":40667.6,"perSecond":0.47068981481481},"debug-bundle":{"releasedAt":"2