This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using Microsoft.Bot.Connector; | |
namespace Microsoft.Extensions.DependencyInjection | |
{ | |
/// <summary> | |
/// Extension methods to add BotAuthentication capabilities to an HTTP application pipeline. | |
/// </summary> | |
public static class BotAuthenticationAppBuilderExtensions | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Threading.Tasks; | |
using Orleans; | |
using GrainInterfaces; | |
using Orleans.Concurrency; | |
namespace Grains | |
{ | |
public class CacheGrain<T>: Grain, ICacheGrain<T> | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.Configure(app => | |
{ | |
app.UseCompressedStaticFiles(); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const CompressionPlugin = require("compression-webpack-plugin"); | |
[...] | |
plugins: [ | |
new CompressionPlugin({ | |
asset: "[path].gz[query]", | |
algorithm: "gzip", | |
test: /\.js$|\.css$/, | |
threshold: 10240, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[...] | |
export default createServerRenderer(params => { | |
return new Promise<RenderResult>((resolve, reject) => { | |
// Match the incoming request against the list of client-side routes | |
match({ routes, location: params.location }, (error, redirectLocation, renderProps: any) => { | |
[...] | |
// Build an instance of the application | |
const store = configureStore(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@{ | |
ViewData["Title"] = "Home Page"; | |
dynamic data = new { sessionId = ViewBag.SessionId, accessToken = ViewBag.AccessToken, xsrfToken = ViewBag.AntiForgeryRequestToken, isAuthenticated = this.User.Identity.IsAuthenticated, userModel = ViewBag.UserModel }; | |
} | |
@* Save the request token in a div. CORS needs to make sure this token can't be read by javascript from other sources than ours *@ | |
<div id="xsrf-token" data-xsrf-token="@ViewBag.AntiForgeryRequestToken"></div> | |
<div id="access-token" data-access-token="@ViewBag.accessToken"></div> | |
<environment names="Development"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var host = new WebHostBuilder() | |
[...] | |
.ConfigureServices(services => | |
{ | |
[...] | |
services.AddNodeServices(options => { | |
if ("development".Equals(environment, StringComparison.OrdinalIgnoreCase)) | |
{ | |
options.LaunchWithDebugging = true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public async Task StartCounterTimer() | |
{ | |
if (this.timer != null) | |
throw new Exception("Can't start: already started"); | |
await this.Dispatch(new StartCounterAction()); | |
await this.WriteStateAsync(); | |
this.timer = this.RegisterTimer(async (state) => { | |
var action = new IncrementCounterAction(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CounterGrain : ReduxGrain<CounterState>, ICounterGrain | |
{ | |
IDisposable storeSubscription; | |
IAsyncStream<IAction> actionsToClientStream; | |
public CounterGrain(ReduxTableStorage<CounterState> storage) : base(CounterState.Reducer, storage) | |
{ | |
} | |
public override async Task OnActivateAsync() |
NewerOlder