Skip to content

Instantly share code, notes, and snippets.


Rob Reynolds ferventcoder

View GitHub Profile
View GetSwap.VB
Public Function GetSwapNumber(ByVal session As ISession, ByVal instrument As Instrument) As String
Dim swapNumber As String = String.Empty
Dim crit As DetachedCriteria = DeCrit.UniqueSwapAssignmentByInstrumentId(instrument)
Dim swapAssignments As IList(Of SwapAssignment)
Dim newSession As ISession = session.GetSession(EntityMode.Poco)
swapAssignments = crit.GetExecutableCriteria(newSession).List(Of SwapAssignment)()
For Each swap As SwapAssignment In swapAssignments
If (swap.Swap IsNot Nothing) Then
View Dude.cs
public class TradeMapping : ClassMap<Trade>
public TradeMapping()
We couldn’t find that file to show.
ferventcoder / TeamCity NuGet auto deploy
Created March 25, 2011 17:14
This is a command line custom script build step for Team City to auto deploy your NuGet packages once built
View TeamCity NuGet auto deploy
xcopy code_drop\nuget\*.nupkg somewhere\Packages /r /i /c /h /k /e /y
ferventcoder / RoundhousEMigrate.cs
Created May 18, 2011 04:28
RoundhousE - Migrations with new semi-fluent interface
View RoundhousEMigrate.cs
new Migrate().Set(p =>
p.ConnectionString = connectionString;
p.SqlFilesDirectory = scriptsLocation;
p.EnvironmentName = environmentName;
p.Drop = dropDatabase;
p.RecoveryModeSimple = useSimpleRecoveryMode;
p.Restore = restore;
p.RestoreFromPath = restorePath;
p.RepositoryPath = repositoryPath;
ferventcoder / DropkicKSecurity.cs
Created June 2, 2011 20:55
DropkicK Security settings
View DropkicKSecurity.cs
DeploymentStepsFor(File, s =>
s.Security(o =>
o.ForPath(settings.InstallPath, p =>
p.Grant(Rights.ReadWrite, settings.UserGroupA);
ferventcoder / TheDeployment.cs
Created June 9, 2011 17:47
DropkicK Deployment Example
View TheDeployment.cs
using System.IO;
using System.Security.Cryptography.X509Certificates;
using dropkick.Configuration.Dsl;
using dropkick.Configuration.Dsl.Files;
using dropkick.Configuration.Dsl.Iis;
using dropkick.Configuration.Dsl.RoundhousE;
using dropkick.Configuration.Dsl.Security;
using dropkick.Configuration.Dsl.WinService;
using dropkick.Wmi;
ferventcoder / setup.cmd
Created July 26, 2011 20:22
Setting up a development environment with chocolatey
View setup.cmd
@echo off
SET DIR=%~dp0%
@PowerShell -NoProfile -ExecutionPolicy unrestricted -Command "& '%DIR%setup.ps1' %*"
ferventcoder / Moq.cs
Created July 29, 2011 21:47
Moq Issue
View Moq.cs
mock.Verify(m => m.Subscribe<Message>(someclass.SomeMethod, null, x => true), Times.AtLeastOnce());
ferventcoder / 1Q_ForEachSafeNullCheck.cs
Created August 2, 2011 16:50
IEnumerable Null Safeguard Extension - Useful When Iterating (ForEach Loop)
View 1Q_ForEachSafeNullCheck.cs
foreach (var item in items ?? new List<string>())
//do something