Skip to content

Instantly share code, notes, and snippets.

@martinsmith1968
martinsmith1968 / xd2md.cs
Created November 16, 2016 17:42 — forked from formix/xd2md.cs
Generates Markdown From VisualSturio XML documentation files
using System;
using System.Collections.Generic;
using System.IO;
using System.Text.RegularExpressions;
using System.Xml;
using System.Xml.Linq;
namespace Formix.Utils
{
class Program
@martinsmith1968
martinsmith1968 / SequenceNumbers.sql
Created April 30, 2020 12:22
SQL Server Manual Sequence Numbers
-- DROP TABLE [SequenceNumbers]
IF OBJECT_ID('SequenceNumbers', 'U') IS NULL BEGIN
CREATE TABLE [SequenceNumbers]
(
[Name] SYSNAME PRIMARY KEY,
[Start] INT NOT NULL DEFAULT 0,
[Increment] INT NOT NULL DEFAULT 1,
[Current] INT NOT NULL,
@martinsmith1968
martinsmith1968 / ExtendedMemoryConfigurationProvider.cs
Last active June 29, 2020 08:42
Convenient IConfiguration for Testing
namespace DNX.ExtendedMemoryConfiguration
{
public class ExtendedMemoryConfigurationSource : IConfigurationSource
{
/// <summary>
/// The initial key value configuration pairs.
/// </summary>
public IDictionary<string, string> Data { get; set; }
/// <summary>
@martinsmith1968
martinsmith1968 / docker-compose.yml
Last active October 25, 2020 13:51
Docker Compose file for ElasticSearch 7.9.3 with Kibana 7.9.3
version: '2.2'
# Docker compose fiel for ElasticSearch 7.9.3 with Kibana 7.9.3
# Based on: https://www.elastic.co/guide/en/elastic-stack-get-started/current/get-started-docker.html
services:
elasticsearch793:
image: docker.elastic.co/elasticsearch/elasticsearch:7.9.3
container_name: elasticsearch793
@martinsmith1968
martinsmith1968 / SetDarkMode.cmd
Created October 25, 2020 14:03
Set Kibana Dark Mode
curl -X POST -d @darkmode.json -H "kbn-xsrf: 123" -H "Content-Type: application/json" localhost:5601/api/kibana/settings/theme:darkMode
@martinsmith1968
martinsmith1968 / MultipleOutputHelper.ttinclude
Last active December 3, 2022 13:38
Multiple output files from T4
<#@ assembly name="System.Core"
#><#@ assembly name="System.Data.Linq"
#><#@ assembly name="EnvDTE"
#><#@ assembly name="System.Xml"
#><#@ assembly name="System.Xml.Linq"
#><#@ import namespace="System.Collections.Generic"
#><#@ import namespace="System.IO"
#><#@ import namespace="System.Text"
#><#@ import namespace="Microsoft.VisualStudio.TextTemplating"
#><#+
@martinsmith1968
martinsmith1968 / DynamicSequenceNumbers.sql
Last active February 6, 2023 13:48
Dynamic Sequence Numbers in SQL
-- Discussion on similar approach : https://stackoverflow.com/questions/2450695/sql-server-concurrency-and-generated-sequence
-- DROP TABLE [SequenceNumbers]
IF OBJECT_ID('SequenceNumbers', 'U') IS NULL BEGIN
CREATE TABLE [SequenceNumbers]
(
[Name] SYSNAME PRIMARY KEY,
[Start] BIGINT NOT NULL DEFAULT 1,