Skip to content

Instantly share code, notes, and snippets.

@segilbert
segilbert / gist:10435316
Created April 11, 2014 01:02
XUnit AAA Resharper Template
[Fact]
public void $Method$_$Scenario$_$Expected$()
{
// Arrange
$END$
// Act
// Assert
}
@segilbert
segilbert / fb.ng.ctrl.sublime-snippet.xml
Last active August 29, 2015 14:07
Angular Controller Sublime Code Snippet
<snippet>
<content><![CDATA[
(function (){
'use strict';
angular.module('${1:AppName}')
.controller('${2:controllerName}', [${2:controllerName}]);
function ${2:controllerName}(){
var vm = this;
@segilbert
segilbert / BoxstarterBuildAutomationExample
Last active August 29, 2015 14:17
Boxstarter Build Automation Example
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 / gist:4793110e6cf1efa77451
Last active August 29, 2015 14:18
Development Machine Setup
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 / move.directories.cmd
Created July 30, 2015 12:16
Driver script, using move.directory.cmd command to deep copy a folder from C:\ to D:\, delete the folder once copied and create a sysmlink.
REM
REM ** USE AT YOUR OWN RISK **
REM
REM Uses move.directory.cmd command to deep copy a folder from C:\ to D:\
REM delete the folder once copied and create a sysmlink.
REM Simply pass in the folder to move.
REM
REM Visual Studio uses "\ProgramData\Package Cache" to store installed
REM packages. These packages are required for VS to uninstall packages
@segilbert
segilbert / move.directory.cmd
Created July 30, 2015 12:15
A helper function to deep copy a folder from C:\ to D:\, delete the folder once copied and create a sysmlink.
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 / complus_remove_apps
Created January 20, 2012 21:15
Remove COM+ Applications Pro-grammatically from COM+ Services
On Error Resume Next
For Each objItem in colItems
' Create an instance of COMAdmin Catalog
set cat = CreateObject( "COMAdmin.COMAdminCatalog" )
' Reference the Applications Collection
Set apps = cat.GetCollection("Applications")
' Retrieve the data
apps.Populate
@segilbert
segilbert / IdeaStrikeSpecBase.cs
Created April 5, 2012 14:42
IdeaStrike Test Project Nancy Autofac Bootstrapper
//
using System;
using System.Collections.ObjectModel;
using System.Linq;
using System.Linq.Expressions;
using System.Drawing;
using System.IO;
using System.Drawing.Imaging;
//
using Ideastrike;
@segilbert
segilbert / CxServices.asmx
Created April 18, 2012 12:53
Quiz Question: How do I use webMethod to call GetMessages?
[WebMethod(true)]
public string GetMessages(string psUserId)
{
List<JxMessage> messages = new List<JxMessage>();
// .... do some logic like get the message list
// Send it back as JSON
return CxJSONHelper.Serialize(messages);
}
@segilbert
segilbert / TestHelper.cs
Last active December 13, 2015 22:08 — forked from sinairv/TestHelper.cs
public static class TestHelpers
{
public static void ShouldEqualWithDiff(this string actualValue, string expectedValue)
{
ShouldEqualWithDiff(actualValue, expectedValue, StringComparison.Ordinal, DiffStyle.Full, Console.Out, string.Empty);
}
public static void ShouldEqualWithDiff(this string actualValue, string expectedValue, string message)
{
ShouldEqualWithDiff(actualValue, expectedValue, StringComparison.Ordinal, DiffStyle.Full, Console.Out, message);