This file contains 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 abstract class DbTest { | |
protected MyDbContext Db; | |
private DbConnection _connection; | |
protected abstract DbConnection DbConnection { get; } | |
[SetUp] | |
public virtual void Setup() { | |
CreateContext(true); | |
Db.Database.CreateIfNotExists(); | |
Db.Database.Initialize(true); |
This file contains 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 static class Authentication { | |
public const string Secret = "123@123"; | |
public static void Setup(IPipelines pipelines, Db db) { | |
var c = new StatelessAuthenticationConfiguration(ctx => { | |
var username = ctx.Request.Headers[Constants.HeaderUsername].FirstOrDefault(); | |
var hash = ctx.Request.Headers[Constants.HeaderHash].FirstOrDefault(); | |
if (String.IsNullOrEmpty(username)) { | |
return null; | |
} |
This file contains 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.Threading.Tasks; | |
namespace ConsoleApplication1 { | |
internal class Program { | |
private static void Main(string[] args) { | |
RunAsync().Wait(); | |
} | |
private static async Task RunAsync() { | |
//your async code |
This file contains 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
/* | |
* Arduino.cs - Arduino/firmata library for Visual C# .NET | |
* Copyright (C) 2009 Tim Farley | |
* | |
* Special thanks to David A. Mellis, on whose Processing library | |
* this code is based. | |
* | |
* This library is free software; you can redistribute it and/or | |
* modify it under the terms of the GNU Lesser General Public | |
* License as published by the Free Software Foundation; either |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
//Just for the sake of constraint | |
public interface INakeTaskConfiguration { } | |
//NakeTask base class | |
public abstract class NakeTask | |
{ | |
protected readonly IDictionary<string, Action> Do = new Dictionary<string, Action>(); | |
public virtual void Initialize() | |
{ |
This file contains 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 BrowserInfo | |
{ | |
private readonly HttpContextBase _context; | |
public BrowserInfo(HttpContextBase context) | |
{ | |
_context = context; | |
} | |
public HttpBrowserCapabilitiesBase HttpBrowserCapabilities |
This file contains 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.Collections.Generic; | |
using System.Web.Http; | |
using System.Web.Mvc; | |
using System.Web.Routing; | |
using FamilyClub.Data.Mappers; | |
using FamilyClub.Model; | |
using TecUnica.Core.Data.NPoco; | |
namespace FamilyClub |
This file contains 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
function MessageBus() { | |
var self = this; | |
var subscribable = new ko.subscribable(); | |
self.publish = function (bus, message) { | |
subscribable.notifySubscribers(message, bus); | |
}; | |
self.subscribe = function (bus, callback, callbackTarget) { | |
subscribable.subscribe(function (message) { | |
callback(ko.toJS(message)); | |
}, callbackTarget || this, bus); |
This file contains 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 Chat : Hub | |
{ | |
public void LoadPlotData() | |
{ | |
ThreadPool.QueueUserWorkItem(x => { | |
var firstPlotData = Db.LoadFirstPlotData(); | |
Clients.Caller.firstPlotDataRetrieved(firstPlotData); | |
}); | |
ThreadPool.QueueUserWorkItem(x => { |