Skip to content

Instantly share code, notes, and snippets.

View sixeyed's full-sized avatar

Elton Stoneman sixeyed

View GitHub Profile
@sixeyed
sixeyed / SaveQuote_Full.cs
Last active December 21, 2015 04:09
Saving a quote with the Dynamics CRM SDK, using a service identity in a back-end process.
using System;
using System.Linq;
using System.ServiceModel.Description;
using x.y.z.ServiceAgents.DynamicsCrm.OrganizationService;
using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Client;
namespace x.y.z.Services.Quotes
{
public static class SaveQuote
@sixeyed
sixeyed / QueueClient.cs
Created October 11, 2013 19:38
A wrapper for the SQS client in the AWS SDK for.NET v2, which uses the message-pump pattern
using Amazon;
using Amazon.SQS;
using Amazon.SQS.Model;
using Amazon.SQS.Util;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
namespace Sixeyed.Blogging.Aws
@sixeyed
sixeyed / QueueClient.cs
Last active September 1, 2020 17:37
Wrappers for the SQS and SNS clients in the AWS SDK for .NET v2
using Amazon;
using Amazon.SQS;
using Amazon.SQS.Model;
using Amazon.SQS.Util;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading;
namespace Sixeyed.Blogging.Aws
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
namespace Sixeyed.Framework
{
public class TaskBatcher : IDisposable
{
private int _batchSize;
private int _batchIndex = 0;
@sixeyed
sixeyed / CREATE-Database.sql
Created January 8, 2014 20:25
SQL Server CREATE scripts for the SQL Server versus MongoDB concurrency shoot-out: http://wblo.gs/eLB
USE [master]
GO
/****** Object: Database [Domain] Script Date: 08/01/2014 20:22:31 ******/
CREATE DATABASE [Domain]
CONTAINMENT = NONE
ON PRIMARY
( NAME = N'Domain', FILENAME = N'C:\Databases\Domain.mdf' , SIZE = 32832KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
LOG ON
( NAME = N'Domain_log', FILENAME = N'C:\Databases\Domain_log.ldf' , SIZE = 152384KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
@sixeyed
sixeyed / DiagnosticCheckCollection.cs
Created January 15, 2014 21:29
Generic server diagnostics - with WebApi controller sample
using System.Collections.Generic;
namespace Sixeyed.Diagnostics.Models
{
public class DiagnosticCheckCollection
{
public string CollectionName { get; set; }
public bool? Passed { get; set; }
@sixeyed
sixeyed / DefaultBus.cs
Created January 17, 2014 08:38
Mutator for NServiceBus which compresses large messages (>1Kb)
using Sixeyed.NServiceBus.Mutators;
using log4net.Config;
using Microsoft.Practices.Unity;
using NServiceBus;
using NServiceBus.Features;
using nsb = NServiceBus;
namespace Sixeyed.NServiceBus
{
public static class DefaultBus
@sixeyed
sixeyed / IHttpActionResultExtensions.cs
Created April 8, 2014 12:45
Wrapping WebApi IHttpActionResult to expose the response message to controllers
using SampleApi.Results;
using System;
using System.Net.Http;
using System.Web.Http;
namespace SampleApi
{
public static class IHttpActionResultExtensions
{
public static IHttpActionResult With(this IHttpActionResult inner, string responsePhrase = null, Action<HttpResponseMessage> responseAction = null)
@sixeyed
sixeyed / ContentCache.cs
Created June 4, 2014 15:18
WebApi caching passthrough controller - passthrough JSON from another URL, using simple in-memory cache
using System;
using System.Runtime.Caching;
using System.Web.Http;
using System.Xml;
namespace Sixeyed.Api.Core
{
public class ContentCache
{
private static MemoryCache _Cache;
using Newtonsoft.Json.Linq;
using System;
using System.Configuration;
using System.Net;
using System.Runtime.Caching;
using System.Xml;
namespace Api.Core
{
/// <summary>