Skip to content

Instantly share code, notes, and snippets.

View dbones's full-sized avatar
☄️
Coding the dotNEXT

Dave R. dbones

☄️
Coding the dotNEXT
View GitHub Profile
@dbones
dbones / gist:9569663
Created March 15, 2014 16:07
classes which I use for testing ( ArmChair which is hopefully comming soon )
/// <summary>
/// base for all domain object which use this Uow
/// </summary>
public abstract class EntityRoot
{
public virtual int Id { get; protected set; }
}
public class Book : EntityRoot
@dbones
dbones / program.cs
Created June 22, 2014 20:18
a wrapper around the webrequest, using a connection style. because i can
namespace HttpJsonTest
{
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Text;
using System.Web;
@dbones
dbones / elasticHelloWorld.cs
Last active August 29, 2015 14:18
NEST mapping, index only the first name
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace TestIndex
{
using Nest;
class Program
@dbones
dbones / ObjectComparer.cs
Created August 14, 2011 19:00
Compares 2 objects to see if they are the same or have the same values, tries to handle circluar references (not fully tested, written in a rush)
/// <summary>
/// Compares 2 objects to see if they are the same or have the same values
/// </summary>
public class ObjectComparer
{
private readonly IList<object> _compared;
private readonly IDictionary<Type,IList<string>> _skipList;
public ObjectComparer()
{
@dbones
dbones / HiloIdGenerator.cs
Created May 23, 2012 05:26
Basic Hilo Id Generator class,
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Text;
namespace TestEtl.Infrastructure
{
public interface IIdGenerator
@dbones
dbones / DynamicConfig.cs
Last active October 15, 2015 21:25
small hack, which allows you to load config from Json, Env and others into a Dynamic object
namespace ConfigBuilderTest
{
using System;
using System.Collections;
using System.Collections.Generic;
using System.Dynamic;
using System.Globalization;
using System.IO;
using System.Linq;
using Newtonsoft.Json;
@dbones
dbones / compose.yml
Created November 28, 2015 16:20
wordpress with rancher, docker
blog-lb:
ports:
- 80:80
labels:
io.rancher.scheduler.affinity:host_label: server=proxy
tty: true
image: rancher/load-balancer-service
links:
- blog:blog
stdin_open: true
@dbones
dbones / docker-compose.yaml
Created December 2, 2015 23:14
Kong Api gateway
cassandra:
labels:
io.rancher.scheduler.affinity:host_label: server=stateful
tty: true
image: mashape/cassandra
stdin_open: true
kong:
labels:
io.rancher.scheduler.affinity:host_label: server=application
tty: true
@dbones
dbones / docker-compose.yaml
Last active December 4, 2015 23:47
dev database setup
DocumentLb:
ports:
- 5984:5984
labels:
io.rancher.scheduler.affinity:host_label: server=proxy
tty: true
image: rancher/load-balancer-service
links:
- Document:Document
stdin_open: true
@dbones
dbones / gist:4758935
Created February 12, 2013 00:23
List<T> vs HashSet<T> this is hack out code, it can be done better, but allows you to see how fast the collection will work with an object.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Linq.Expressions;
namespace CollectionTest
{
class Program
{