Skip to content

Instantly share code, notes, and snippets.

class Program
{
static void Main(string[] args)
{
Run().Wait();
}
public static async Task Run()
{
var uri = new Uri("https://myUrl.com");
#!/bin/bash
clear
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list
sudo apt-get update
sudo apt-get -y install mono-devel
sudo apt-get -y install gyp automake make libtool
public ActionResult SentMultipleBackgroundMessage()
{
var amount = 50000;
var stopwatch = new Stopwatch();
stopwatch.Start();
foreach (var index in Enumerable.Range(0, amount))
{
MvcApplication.ServiceBus.Publish(new StartMultipleBackgroundWorkMessage
@daanl
daanl / gist:8717433
Last active August 29, 2015 13:55
Nancy Owin Authentication
public class OwinAuthentication
{
public static void Enable(IPipelines pipelines, OwinAuthenticationConfiguration configuration)
{
if (pipelines == null) throw new ArgumentNullException("pipelines");
if (configuration == null) throw new ArgumentNullException("configuration");
pipelines.BeforeRequest.AddItemToStartOfPipeline(GetLoadAuthenticationHook(configuration));
}
@daanl
daanl / gist:8640316
Created January 26, 2014 22:30
RxTimer
using System;
using System.Reactive.Linq;
using System.Threading.Tasks;
namespace RxTimer
{
class Program
{
static void Main(string[] args)
{
@daanl
daanl / s.js
Created November 21, 2013 10:36
app.directive('toggleButton', [function () {
return {
restrict: 'E',
templateUrl: '/App/views/shared/directives/toggle.button.html',
replace: true,
scope: {
model: '=',
ngDisabled: '='
},
@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: [],
class Program
{
public static List<string> ScreenInformation = new List<string>
{
"hi",
"oi",
"whats",
"up"
};
class Program
{
static void Main(string[] args)
{
var command = new AsyncRelayCommand(
async () =>
{
await Task.Delay(TimeSpan.FromSeconds(1));
Console.WriteLine("hi");
});
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) {}
}