Skip to content

Instantly share code, notes, and snippets.

View dibley1973's full-sized avatar

Duane Dibley dibley1973

  • DCH Foundation Trust
  • Dorchester, Dorset, UK
View GitHub Profile
@dibley1973
dibley1973 / ListOfT_ToDelimitedText.cs
Last active November 8, 2015 22:19
ToDelimitedText() extension for List<T>
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Text;
namespace Gists.Extensions.ListOfTExtentions
{
public static class ListOfTExtentions
{
/// <summary>
@dibley1973
dibley1973 / ClrTypeToSqlDbTypeMapper.cs
Last active November 22, 2020 05:01
ClrTypeToSqlDbTypeMapper for C# .Net
using System;
using System.Collections.Generic;
using System.Data;
namespace Dibware.StoredProcedureFramework.Helpers
{
public static class ClrTypeToSqlDbTypeMapper
{
#region Constructors
@dibley1973
dibley1973 / StoredProcedureDbCommandCreator.cs
Last active December 3, 2015 20:20
C# DbCommand Creator for use with Stored Procedures that is set up with a fluid API
using Dibware.StoredProcedureFramework.Helpers.Base;
using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
namespace Dibware.StoredProcedureFramework.Helpers
{
public class StoredProcedureDbCommandCreator
@dibley1973
dibley1973 / _slickgrid.extensions.js
Last active December 24, 2015 07:36
Slickgrid Extension to create a simple searchable grid
/*
/ File: slickgrid.extensions.js
/ Requires: JQuery
/ SlickGrid
*/
(function ($) {
// Register namespace
$.extend(true, window, {
"Slick": {
@dibley1973
dibley1973 / StatusByInheritance.cs
Created October 15, 2016 13:50
This is just a dump of code for a post describing status by inheritance in C#
public abstract class ItemStatus {}
public class ProposedStatus : ItemStatus {}
public class ActiveStatus : ItemStatus {}
public class ObsoleteStatus : ItemStatus {}
public class MyShizzler
{
public void DoShizzle(ProposedStatus status) { /* Do some Proposed shizzle, or maybe nothing */ }
public void DoShizzle(ActiveStatus status) { /* Do some Activeshizzle */ }
public void DoShizzle(ObsoleteStatus status) { /* Do some Obsolete shizzle, or maybe nothing */ }
@dibley1973
dibley1973 / gethashcode.snippet
Created October 6, 2017 04:18
A simple visual studio code snippet to create `GetHashCode` member in C#
<?xml version="1.0" encoding="utf-8" ?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
<CodeSnippet Format="1.0.0">
<Header>
<Title>Basic GetHashCode Implementation.</Title>
<Shortcut>gethash</Shortcut>
<Description>
Code snippet to create a skeleton implementation
of the the GetHashCode pattern for a class.
</Description>