Skip to content

Instantly share code, notes, and snippets.

View GuidUtility.cs
using System;
using System.Security.Cryptography;
using System.Text;
namespace Utility
{
/// <summary>
/// Helper methods for working with <see cref="Guid"/>.
/// </summary>
@ngbrown
ngbrown / TUT017.md
Created May 13, 2018 — forked from dapperfu/TUT017.md
TUT017 Example YAML to MD.
View TUT017.md

active: true derived: false level: 1.5 links:

  • REQ004: 94f4db8d1a50ab62ee0edec1e28c0afb normative: true ref: '' reviewed: 98ba42c551fec65d9796fee72d15f844 title: Tutorial Requirement 17
View IdentityExtensions.cs
using System;
using System.Security.Principal;
internal static class IdentityExtensions
{
internal static string GetNormalizedLogin(this IIdentity identity)
{
if (identity == null)
{
throw new ArgumentNullException(nameof(identity));
View SQLiteDateRoundTripTests.cs
using System;
using System.Globalization;
using NUnit.Framework;
namespace UnitTestProject1
{
[TestFixture]
public class SQLiteDateRoundTripTests
{
private int _optionToStringInSqLite = 1; // Currently implemented in System.Data.SQLite
@ngbrown
ngbrown / typescript-babel-jest.js
Last active Jul 14, 2017
Transformer helper for Jest to take Typescript through Babel, with sourcemap support.
View typescript-babel-jest.js
"use strict";
/**
*
* This source code is licensed under the BSD-style license.
* Portions of code derived from "babel-jest", copyrighted by
* Facebook, Inc. and released under a BSD-style license.
*
*/
@ngbrown
ngbrown / utilities.js
Last active Nov 29, 2016
redux-little-router utility functions for onClick and onSubmit
View utilities.js
import {PUSH, REPLACE} from "redux-little-router";
import defaultCreateLocation from "redux-little-router/lib/util/create-location.js";
// Adapted from https://github.com/FormidableLabs/redux-little-router
// specifically the Link component (https://github.com/FormidableLabs/redux-little-router/blob/master/src/link.js)
const normalizeHref = ({ basename, pathname, search }) =>
`${basename || ''}${pathname}${search || ''}`;
const normalizeLocation = href => {
@ngbrown
ngbrown / FormatterExtensions.cs
Last active Oct 15, 2016
NancyFX PartialFileResponse
View FormatterExtensions.cs
using System;
using System.IO;
using Nancy;
namespace WebService.Extensions
{
public static class FormatterExtensions
{
public static Response AsPartialFile(this IResponseFormatter formatter, string applicationRelativeFilePath, string contentType)
{
@ngbrown
ngbrown / AboutFramework.cs
Created Oct 5, 2016
Display detailed version information about the .NET framework installed
View AboutFramework.cs
using System;
using Microsoft.Win32;
namespace AboutFramework
{
class Program
{
static void Main(string[] args)
{
GetVersionFromRegistry();
View BowlingKata.cs
namespace BowlingKata02
{
public class Scorer
{
private readonly IList<int> rolls = new List<int>();
private int currentRoll;
private int score;
public int CalculateScore()
{
View [WIP] NH-3807 Pull Request.md

[WIP] NH-3807 Support for .NET Core 1.0 #504

This is currently a work in progress. It does compile and I have ran simple programs against it.

A majority of the changes were done to the mainline .NET version so all the mainline tests could be used during development. There are no tests ported to .NET Core yet, and this may be difficult without the dynamic schema support.

By necessity, it includes #241/NH-3431 - Replace System.Data with System.Data.Common and NH-3853 - Switch binary-serialization to an implementation that is supported by CoreClr.

There are a number of compromises that have to take place on .NET Core, chief among them is that there is no GetSchemaTable(). Without this, none of the dynamic schema generation or updates works. The tests, when implemented, will need a static schema c