Skip to content

Instantly share code, notes, and snippets.

@segilbert
segilbert / After
Last active December 14, 2015 13:28
Tell me what is wrong with this unit test? Hint ... Fails with expect count of 5 but count = 8.
public void CanExecuteNonQueryWithCommandTextWithDefinedTypeAndTransaction()
{
// Arrange
int countBefore = Convert.ToInt32(db.ExecuteScalar(countCommand));
using (DbConnection connection = db.CreateConnection())
{
connection.Open();
using (DbTransaction trans = connection.BeginTransaction())
{
@segilbert
segilbert / CSharp_custom.fit
Created March 19, 2013 20:35
Simple C# custom WinMerge filter.
## This is a directory/file filter template for WinMerge
name: CSharp Custom Filter
desc: Filter out bin dir and project files
## Select if filter is inclusive or exclusive
## Inclusive (loose) filter lets through all items not matching rules
## Exclusive filter lets through only items that match to rule
## include or exclude
def: include
@segilbert
segilbert / getPublicKeyToken.cmd
Last active December 15, 2015 13:09
Obtains the public key token from a strong key or dll.
@ECHO off
REM
REM http://msdn.microsoft.com/en-us/library/k5b5tt23(v=vs.80).aspx
REM http://stackoverflow.com/questions/659647/how-to-get-folder-path-from-file-path-with-cmd
REM
SET SnkFilePath=%1
SET FileExt=%~x1
REM ECHO %FileExt%
@segilbert
segilbert / confluence.mailto.macro
Last active December 19, 2015 14:19
Confluence mailto macro from James Mortimer. Tweaked to remove <br/> from the body before sending to mailto body section to display properly. [Confluence Mailto Macro](https://confluence.atlassian.com/display/DISC/Mailto+User+Macro)
## Check parameters
#if($paramemail && $paramemail.length()>0)
#set($email=$paramemail)
#else
#if($param0 && $param0.length()>0)
#set($email=$param0)
#else
#set($email="first_last@domain.com")
#end
#end
@segilbert
segilbert / 0.ReadMe.md
Last active February 12, 2017 04:18
Ever wanted or had the need to create a version of the MS Northwind SQL Server Database on Oracle? If you are working with EntLib code base and want to run the unit tests then you know what I'm taking about. Please see the readMe.md for additional details.

MS Northwind for Oracle

Summary

Ever wanted or had the need to create a version of the MS Northwind SQL Server Database on Oracle? If you are working with EntLib code base and want to run the unit tests then you know what I'm taking about. The scrips below will create Northwind in an Oracle database.

Scripts: ( order required to be run )

  1. northwind.oracle.schema.sql
  2. northwind.oracle.tables.views..sql
  3. northwind.oracle.packages.sql
  4. northwind.oracle.sps.sql
Set-ExecutionPolicy Unrestricted -Force
Import-Module Boxstarter.Chocolatey
Install-BoxstarterPackage -PackageName https://gist.githubusercontent.com/segilbert/8946331a1e8957c37001fbb7ad815a4c/raw/8b36cd391e2cc135db6c01df3ac879d9fdedebf9/DevTestLabCodeGenMachineWin8Setup.txt
Update-ExecutionPolicy Unrestricted
Set-ExplorerOptions -showHidenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions
Set-TaskbarSmall
Enable-RemoteDesktop
cinst windows-sdk-10.0
cinst visualstudio2013professional
cinst visualstudio2013-sdk
cinst git.install
cinst Boxstarter
Set-ExecutionPolicy Unrestricted -Force
Import-Module Boxstarter.Chocolatey
Install-BoxstarterPackage -PackageName https://gist.githubusercontent.com/segilbert/100f871a406f568bfd9e72d6aac2970a/raw/29562aaa6a8ff164b0033202e1b27185b043e85f/DevTestLabCodeGenMachineWin10Setup.txt
Update-ExecutionPolicy Unrestricted
Set-ExplorerOptions -showHidenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions
Set-TaskbarSmall
Enable-RemoteDesktop
cinst windows-sdk-8.1
cinst visualstudio2013professional
cinst visualstudio2013-sdk
cinst git.install
cinst Boxstarter
@segilbert
segilbert / Git.flt
Created February 21, 2017 23:02
WinMerge Git Internal Folder Filter
## This is a directory/file filter template for WinMerge
name: Git Folder
desc: Filter out all Git Folder (.git) diffs
## Select if filter is inclusive or exclusive
## Inclusive (loose) filter lets through all items not matching rules
## Exclusive filter lets through only items that match to rule
## include or exclude
def: include