Skip to content

Instantly share code, notes, and snippets.

@segilbert
segilbert / move.directory.cmd
Created Jul 30, 2015
A helper function to deep copy a folder from C:\ to D:\, delete the folder once copied and create a sysmlink.
View move.directory.cmd
REM
REM ** USE AT YOUR OWN RISK **
REM
REM robocopy command line options
REM https://technet.microsoft.com/en-us/library/Cc733145.aspx
REM
REM How to move C:\ProgramData Cache to save gigs of space
REM http://superuser.com/questions/455853/can-i-delete-the-the-folder-c-programdata-package-cache
REM
REM Windows 8 specific space savings review link below
@segilbert
segilbert / gist:4793110e6cf1efa77451
Last active Aug 29, 2015
Development Machine Setup
View gist:4793110e6cf1efa77451
Update-ExecutionPolicy Unrestricted
Set-ExplorerOptions -showHidenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions
Set-TaskbarSmall
Enable-RemoteDesktop
# cinst visualstudio2013ultimate
cinst fiddler4
cinst mssqlserver2012express
cinst git-credential-winstore
cinst console2
@segilbert
segilbert / BoxstarterBuildAutomationExample
Last active Aug 29, 2015
Boxstarter Build Automation Example
View BoxstarterBuildAutomationExample
Update-ExecutionPolicy Unrestricted
Set-ExplorerOptions -showHidenFilesFoldersDrives -showProtectedOSFiles -showFileExtensions
Set-TaskbarSmall
Enable-RemoteDesktop
cinst VisualStudio2013ExpressWeb
cinst fiddler4
cinst mssqlserver2012express
cinst git-credential-winstore
cinst console2
@segilbert
segilbert / fb.ng.ctrl.sublime-snippet.xml
Last active Aug 29, 2015
Angular Controller Sublime Code Snippet
View fb.ng.ctrl.sublime-snippet.xml
<snippet>
<content><![CDATA[
(function (){
'use strict';
angular.module('${1:AppName}')
.controller('${2:controllerName}', [${2:controllerName}]);
function ${2:controllerName}(){
var vm = this;
@segilbert
segilbert / gist:10435316
Created Apr 11, 2014
XUnit AAA Resharper Template
View gist:10435316
[Fact]
public void $Method$_$Scenario$_$Expected$()
{
// Arrange
$END$
// Act
// Assert
}
@segilbert
segilbert / confluence.mailto.macro
Last active Dec 19, 2015
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)
View confluence.mailto.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 / getPublicKeyToken.cmd
Last active Dec 15, 2015
Obtains the public key token from a strong key or dll.
View getPublicKeyToken.cmd
@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 / CSharp_custom.fit
Created Mar 19, 2013
Simple C# custom WinMerge filter.
View CSharp_custom.fit
## 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 / 0.ReadMe.md
Last active Feb 12, 2017
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.
View 0.ReadMe.md

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
@segilbert
segilbert / After
Last active Dec 14, 2015
Tell me what is wrong with this unit test? Hint ... Fails with expect count of 5 but count = 8.
View After
public void CanExecuteNonQueryWithCommandTextWithDefinedTypeAndTransaction()
{
// Arrange
int countBefore = Convert.ToInt32(db.ExecuteScalar(countCommand));
using (DbConnection connection = db.CreateConnection())
{
connection.Open();
using (DbTransaction trans = connection.BeginTransaction())
{