Skip to content

Instantly share code, notes, and snippets.

@martinjw
martinjw / BuildCommon.targets
Created January 10, 2017 11:05
Change version number in a build script (from lionhack.com)
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--
http://www.lionhack.com/2014/02/13/msbuild-override-assembly-version/
-->
<PropertyGroup>
<!-- This doesn't work -->
<BeforeCompile>
CommonBuildDefineModifiedAssemblyVersion;
$(BeforeCompile);
@martinjw
martinjw / xhtml-entities.ent
Created September 17, 2015 18:06
Html entities dtd
<!-- A local copy of (X)HTML entities, containing the three subsets:
Latin-1 characters: http://www.w3.org/TR/xhtml1/DTD/xhtml-lat1.ent
Special characters: http://www.w3.org/TR/xhtml1/DTD/xhtml-special.ent
Mathematical, Greek and Symbolic characters: http://www.w3.org/TR/xhtml1/DTD/xhtml-symbol.ent
-->
<!-- Portions (C) International Organization for Standardization 1986:
Permission to copy in any form is granted for use with
conforming SGML systems and applications as defined in
ISO 8879, provided this notice is included in all copies.
-->
@martinjw
martinjw / SqlExceptionMocker.cs
Last active October 16, 2022 21:02 — forked from timabell/SqlExceptionMocker.cs
Create a SqlException for testing
using System.Data.SqlClient;
using System.Reflection;
namespace HorribleThingsInHere
{
/// <summary>
/// Workaround completely test-unfriendly sql error classes.
/// Copy-paste from http://stackoverflow.com/a/1387030/10245
/// Adjusted with updates in comments
/// Adjusted to not use ctor indexes