Skip to content

Instantly share code, notes, and snippets.

View dealproc's full-sized avatar

Richard Bennett dealproc

View GitHub Profile
@dealproc
dealproc / sslassignment.ps1
Created August 15, 2014 03:13
SSL Creation using NetSH
## --------------------------------------------------------------------------------------
## Input
## --------------------------------------------------------------------------------------
$webSiteName = $OctopusParameters['WebSiteName']
$bindingPort = $OctopusParameters["BindingPort"]
$bindingIpAddress = $OctopusParameters["BindingIpAddress"]
$bindingHost = $OctopusParameters["BindingHost"]
$bindingSslThumbprint = $OctopusParameters["BindingSslThumbprint"]
@dealproc
dealproc / AccountAccessor.cs
Last active August 29, 2015 14:07
NHibernateSessionSource
using NHibernate;
using NLog;
public class AccountAccessor : IAccountAccessor {
Logger Log = LogManager.GetCurrentClassLogger();
ISessionFactory _SessionFactory;
public AccountAccessor(ISessionFactory sessionFactory) {
_SessionFactory = sessionFactory;
}
@dealproc
dealproc / ThreadSafeObservableCollection.cs
Created November 24, 2014 19:25
ThreadSafeObservableCollection.cs
using System;
using System.Collections.ObjectModel;
using System.Threading;
using System.Windows.Threading;
using Kiosk.Error;
using Kiosk.Globals;
namespace Kiosk.Gui.Types
{
[Serializable]
@dealproc
dealproc / Customer.cs
Last active August 29, 2015 14:13
Full Duplex Routing
public class Customer : HQDataModelBase {
public virtual string FirstName { get; set; }
public virtual string LastName { get; set; }
public virtual string HomePhone { get; set; }
public virtual string MobilePhone { get; set; }
public virtual string BusinessPhone { get; set; }
public virtual string Email { get; set; }
public virtual Address Address { get; set; }
}
@dealproc
dealproc / DialogManager.cs
Created January 16, 2015 14:15
MahApps.Metro & Caliburn Micro DialogViewManager Implementation .. basis was from someone else, but I had to re-tool it to work the way i wanted. It seems as if full binding is working as expected as well using the CM pipeline :)
using {Product}.UX.ViewModels.Framework;
using Caliburn.Micro;
using MahApps.Metro.Controls;
using MahApps.Metro.Controls.Dialogs;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;
namespace {Product}.UX.Services {
public class DialogManager : IDialogManager {
public static readonly MetroDialogSettings dialogSettings = new MetroDialogSettings {
namespace {Product}.Infrastructure.Framework {
using FluentValidation;
using FluentValidation.Results;
using System;
using System.Text;
public static class ValidationHelper {
public static ValidationResult Validate<T, K>(K entity)
where T : IValidator<K>, new()
where K : class {
IValidator<K> __Validator = new T();
@dealproc
dealproc / Class1.cs
Last active August 29, 2015 14:15
Setting a member without the "null reference" spam
using System;
using System.Linq.Expressions;
using System.Reflection;
using Xunit;
namespace ReflectedConstructor {
public static class MemberExpressions {
public static MemberInfo GetMemberInfo(this Expression expression) {
var lambda = (LambdaExpression)expression;
MemberExpression memberExpression;
@dealproc
dealproc / Deploy.ps1
Created March 2, 2015 08:19
Using Fluent Migrator with Octopus Deploy
if (!$MainDB) {
$MainDB = '...';
}
tools\migrate.exe --task migrate --connection "$MainDB" --provider "SqlServer2012" --assembly "lib\net45\Adapt.Gift.DatabaseScripts.dll" --tps
using System;
using System.Reflection;
using CommonDomain;
using CommonDomain.Core;
using CommonDomain.Persistence;
using CommonDomain.Persistence.EventStore;
using NEventStore;
using NEventStore.Dispatcher;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using ServiceStack.Net30.Collections.Concurrent;
/// <summary>
/// Helper class redirects events to private Apply(event) method