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
[Test] | |
public async Task Can_Save_OrderEvent_With_EntityFramework_And_PostgresSQL() | |
{ | |
using (var context = new CqrsContext()) | |
{ | |
var orderEvent = new OrderEvent | |
{ | |
Id = Guid.NewGuid() | |
}; |
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
await Console.WriteLineAsync("message: {0}", "hi"); | |
public static class Console | |
{ | |
public static async Task WriteLineAsync(string message, params object[] formatArguments) | |
{ | |
await Task.Run(() => System.Console.WriteLine(message, formatArguments)); | |
} | |
} |
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
// ==UserScript== | |
// @name JabbR: Admin Kick Banned Users | |
// @namespace http://jabbr.net.admin/ | |
// @version 0.1 | |
// @description Kick mother bitches from JabbR who have been a pesk. | |
// @match https://jabbr.net/* | |
// @copyright 2013+, JabbR people | |
// @require http://code.jquery.com/jquery-latest.js | |
// ==/UserScript== |
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
// async each non blocking | |
(function ($) { | |
$.fn.eachAsync = function (enumerable, callback) { | |
$.each(enumerable, function (index, element) { | |
var thisScope = this; | |
setTimeout(function() { | |
callback.apply(thisScope, [index, element]); |
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
private string GetCanonicalizedResource(Uri address, string accountName) | |
{ | |
var builder = new StringBuilder(); | |
builder.Append("/"); | |
builder.Append(accountName); | |
builder.Append(address.AbsolutePath); | |
var values2 = new NameValueCollection(); | |
var values = HttpUtility.ParseQueryString(address.Query); | |
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 string GetCanonicalizedHeaders(HttpWebRequest request) | |
{ | |
ArrayList headerNameList = new ArrayList(); | |
StringBuilder sb = new StringBuilder(); | |
foreach (string headerName in request.Headers.Keys) | |
{ | |
if (headerName.ToLowerInvariant().StartsWith("x-ms-", StringComparison.Ordinal)) | |
{ | |
headerNameList.Add(headerName.ToLowerInvariant()); | |
} |
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 ActionRunner | |
{ | |
public void Run(Action action) | |
{ | |
action(); | |
} | |
} | |
ActionRunner.Run( | |
async () => |
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 User : IPrincipal | |
{ | |
public User(string username, IEnumerable<string> roles) | |
{ | |
Username = username; | |
Roles = roles; | |
} | |
public string Username { get; private set; } | |
public IEnumerable<string> Roles { get; private set; } |
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.Linq.Expressions; | |
using NUnit.Framework; | |
namespace ClassLibrary1 | |
{ | |
[TestFixture] | |
public class Class2 | |
{ | |
[Test] |
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
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var store = new EmbeddableDocumentStore | |
{ | |
DataDirectory = "Data" | |
}; | |
store.Initialize(); |