Skip to content

Instantly share code, notes, and snippets.

Avatar

Duane Dibley dibley1973

  • Flowbird (formerly Parkeon)
  • Dorset, UK
View GitHub Profile
@dibley1973
dibley1973 / gethashcode.snippet
Created Oct 6, 2017
A simple visual studio code snippet to create `GetHashCode` member in C#
View gethashcode.snippet
<?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>
@dibley1973
dibley1973 / StatusByInheritance.cs
Created Oct 15, 2016
This is just a dump of code for a post describing status by inheritance in C#
View StatusByInheritance.cs
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 / _slickgrid.extensions.js
Last active Dec 24, 2015
Slickgrid Extension to create a simple searchable grid
View _slickgrid.extensions.js
/*
/ File: slickgrid.extensions.js
/ Requires: JQuery
/ SlickGrid
*/
(function ($) {
// Register namespace
$.extend(true, window, {
"Slick": {
@dibley1973
dibley1973 / StoredProcedureDbCommandCreator.cs
Last active Dec 3, 2015
C# DbCommand Creator for use with Stored Procedures that is set up with a fluid API
View StoredProcedureDbCommandCreator.cs
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 / ClrTypeToSqlDbTypeMapper.cs
Last active Nov 22, 2020
ClrTypeToSqlDbTypeMapper for C# .Net
View ClrTypeToSqlDbTypeMapper.cs
using System;
using System.Collections.Generic;
using System.Data;
namespace Dibware.StoredProcedureFramework.Helpers
{
public static class ClrTypeToSqlDbTypeMapper
{
#region Constructors
@dibley1973
dibley1973 / ListOfT_ToDelimitedText.cs
Last active Nov 8, 2015
ToDelimitedText() extension for List<T>
View ListOfT_ToDelimitedText.cs
using System;
using System.Collections.Generic;
using System.Reflection;
using System.Text;
namespace Gists.Extensions.ListOfTExtentions
{
public static class ListOfTExtentions
{
/// <summary>