Skip to content

Instantly share code, notes, and snippets.

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());
}
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);
// 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]);
// ==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==
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));
}
}
[Test]
public async Task Can_Save_OrderEvent_With_EntityFramework_And_PostgresSQL()
{
using (var context = new CqrsContext())
{
var orderEvent = new OrderEvent
{
Id = Guid.NewGuid()
};
public class JsonContent : StringContent
{
public JsonContent(object contentObject) : base(JsonConvert.SerializeObject(contentObject), Encoding.UTF8, "application/json") {}
public JsonContent(string content) : base(content) {}
public JsonContent(string content, Encoding encoding) : base(content, encoding) {}
public JsonContent(string content, Encoding encoding, string mediaType) : base(content, encoding, mediaType) {}
}
class Program
{
static void Main(string[] args)
{
var command = new AsyncRelayCommand(
async () =>
{
await Task.Delay(TimeSpan.FromSeconds(1));
Console.WriteLine("hi");
});
class Program
{
public static List<string> ScreenInformation = new List<string>
{
"hi",
"oi",
"whats",
"up"
};
@daanl
daanl / wysihtml5.js
Created October 30, 2013 20:16
Needed plugins wysihtml5 bootstrap-wysihtml5
angular.module('directives', [])
.directive('wysihtml5', ['$timeout', function ($timeout) {
return {
restrict: 'A',
require: 'ngModel',
link: function ($scope, $element, attrs, ngModel) {
var element = $($element).wysihtml5({
stylesheets: [],