Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Rob Reynolds ferventcoder

🎯
Focusing
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()
{
HibernateMapping.Schema("dbo");
Table("Trades");
Not.LazyLoad();
HibernateMapping.DefaultAccess.Property();
HibernateMapping.DefaultCascade.SaveUpdate();
We couldn’t find that file to show.
@ferventcoder
ferventcoder / TeamCity NuGet auto deploy
Created Mar 25, 2011
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
ferventcoder / RoundhousEMigrate.cs
Created May 18, 2011
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
ferventcoder / DropkicKSecurity.cs
Created Jun 2, 2011
DropkicK Security settings
View DropkicKSecurity.cs
DeploymentStepsFor(File, s =>
{
s.Security(o =>
{
o.ForPath(settings.InstallPath, p =>
{
p.GrantRead(settings.UserGroupA);
p.GrantReadWrite(settings.UserGroupB);
p.Grant(Rights.ReadWrite, settings.UserGroupA);
@ferventcoder
ferventcoder / TheDeployment.cs
Created Jun 9, 2011
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
ferventcoder / setup.cmd
Created Jul 26, 2011
Setting up a development environment with chocolatey
View setup.cmd
@echo off
SET DIR=%~dp0%
@PowerShell -NoProfile -ExecutionPolicy unrestricted -Command "& '%DIR%setup.ps1' %*"
pause
View Moq.cs
mock.Verify(m => m.Subscribe<Message>(someclass.SomeMethod, null, x => true), Times.AtLeastOnce());
@ferventcoder
ferventcoder / 1Q_ForEachSafeNullCheck.cs
Created Aug 2, 2011
IEnumerable Null Safeguard Extension - Useful When Iterating (ForEach Loop)
View 1Q_ForEachSafeNullCheck.cs
foreach (var item in items ?? new List<string>())
{
//do something
}