I hereby claim:
- I am benfoster on github.
- I am benfoster (https://keybase.io/benfoster) on keybase.
- I have a public key ASAHVC9RNoa9g8n5MtUGFrXPGegaMX-gzzUSdmnbeKJSwgo
To claim this, I am signing this object:
var http = require('http'), | |
fs = require('fs'); | |
var server = http.createServer(function(request, response) { | |
var file = fs.createWriteStream('upload.jpg'), | |
fileBytes = request.headers['content-length'], | |
uploadedBytes = 0; | |
request.on('data', function(chunk) { | |
uploadedBytes += chunk.length; |
I hereby claim:
To claim this, I am signing this object:
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Threading.Tasks; | |
namespace PipelineDemo | |
{ | |
// http://www.rantdriven.com/post/2009/09/16/Simple-Pipe-and-Filters-Implementation-in-C-with-Fluent-Interface-Behavior.aspx | |
public interface IFilter<TContext> | |
{ |
using NSubstitute; | |
using NUnit.Framework; | |
using System.Collections.ObjectModel; | |
using System.Net; | |
using System.Net.Http; | |
using System.Security.Claims; | |
using System.Security.Principal; | |
using System.Threading; | |
using System.Web.Http; | |
using System.Web.Http.Controllers; |
using Newtonsoft.Json; | |
using System; | |
using System.Collections.Concurrent; | |
using System.Collections.Generic; | |
using System.ComponentModel.DataAnnotations; | |
using System.Diagnostics.CodeAnalysis; | |
using System.Dynamic; | |
using System.Linq; | |
using System.Linq.Expressions; | |
using System.Net; |
using System; | |
using System.Collections.Concurrent; | |
using System.Collections.Generic; | |
using System.ComponentModel.DataAnnotations; | |
using System.Linq; | |
using System.Net; | |
using System.Net.Http; | |
using System.Web.Http; | |
using System.Web.Http.Controllers; | |
using System.Web.Http.Dependencies; |
using System; | |
using System.Collections.Concurrent; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using System.Threading.Tasks.Dataflow; | |
namespace TDFDemo | |
{ | |
class Program | |
{ |
private void InitializeViewEngine() | |
{ | |
HostingEnvironment.RegisterVirtualPathProvider(new DynamicAssetVirtualPathProvider()); | |
ViewEngines.Engines.Clear(); | |
ViewEngines.Engines.Add(new ThemableViewEngine | |
{ | |
Theme = ctx => DependencyResolver.Current.GetService<ISiteContext>().Theme.ThemeName | |
}); |
public static void Execute(ChargeCommand command) | |
{ | |
var pipeline = new PipelineBuilder<ChargeContext>() | |
.Register(new TimingHandler()) | |
.Register(new LoggingHandler()) | |
.Register(new ValidationHandler( | |
validationPipeline => | |
{ | |
validationPipeline.Register(new AmountValidator(maxAmount: 500)); | |
} |
using AppFunc = Func<IDictionary<string, object>, Task>; | |
public static class OwinPipelineHookExtensions | |
{ | |
public static IAppBuilder UseHooks( | |
this IAppBuilder app, | |
Action<IDictionary<string, object>> before = null, | |
Action<IDictionary<string, object>> after = null) | |
{ | |
return app.Use(new Func<AppFunc, AppFunc>(next => (async env => |