Skip to content

Instantly share code, notes, and snippets.

@RAGNOARAKNOS
RAGNOARAKNOS / SimpleContract.cs
Created July 13, 2016 13:46
Simple version of Code Contracts
View SimpleContract.cs
using System;
using System.Diagnostics;
/// <summary>
/// Provides conditional contract assertions.
/// </summary>
public static class Contract
{
#region NotNull
/// <summary>
@RAGNOARAKNOS
RAGNOARAKNOS / PeskySSL.cs
Created July 12, 2016 16:52
Remove those pesky SSL failures in a devtest environment
View PeskySSL.cs
using System.Net;
// Apply SSL authentication workaround to bypass SSL enforcement for local development
ServicePointManager.ServerCertificateValidationCallback =
(sender, cert, chain, sslPolicyErrors) => true;
@RAGNOARAKNOS
RAGNOARAKNOS / HttpContentExtensions.cs
Created July 5, 2016 10:02
Extend the .NET HTTPContent class (used by HTTPClient) to download files, with usage example
View HttpContentExtensions.cs
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Security.Cryptography;
using System.Text;