This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$url = "http://<url>?WSDL" | |
$name = "<Service Name>" | |
$namespace = "<Base Namespace>." + $name | |
$file = "$name.generated.cs" | |
echo "Generating service $name ($url)" | |
& "C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools\SvcUtil.exe" /t:code $url /language:C# /n:"*,$namespace" /out:$file /noConfig /syncOnly | out-null | |
(Get-Content $file) | Foreach-Object {$_ -replace "(?<=public [\w\.]+(?:\[\])? \w+)(;)", " { get; set; }"} | Set-Content $file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
This script helps simulate deadlocks. Run the entire script in a SQL query window. It will continue running until stopped. | |
In the target script, insert a call to sp_simulatedeadlock where you want the deadlock to occur. | |
This stored procedure, also created below, causes the deadlock. | |
When you are done, stop the execution of this window and run the code in the cleanup section at the bottom. | |
*/ | |
SET NOCOUNT ON | |
IF OBJECT_ID('DeadlockTest') IS NOT NULL | |
DROP TABLE DeadlockTest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace ShowConsole | |
{ | |
using System; | |
using System.Runtime.InteropServices; | |
using System.Windows.Forms; | |
public static class Program | |
{ | |
[DllImport("kernel32.dll", SetLastError = true)] | |
[return: MarshalAs(UnmanagedType.Bool)] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Parameters are expected in the following order: | |
# 1. Path to ms deploy eg. "C:\Program Files\IIS\Microsoft Web Deploy V3\msdeploy.exe" | |
# 2. Source server name eg. server1.domain.net | |
# 3. Path to setParameters.xml which contains 'IIS Web Application Name' override [Comma delimitted] | |
# 4. User name eg. domain\username | |
# 5. Password eg. ****** (Caveat: not escaped) | |
# 6. Destination server name(s) [Comma delimitted] eg. server2.domain.net,server3.domain.net | |
param ( | |
[parameter(Mandatory=$true)] [string]$msdeploy, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Submit with a single parameter of a comma delimted list of key=value pairs. | |
# Caveat: no escaping is performed, so the script will go awry if the value contains a ',' and the script is not modified | |
param ( | |
[parameter(Mandatory=$true)] [string]$raw | |
) | |
$filter = '*.setParameters.xml' | |
$lookup = ConvertFrom-StringData ($raw.split(",") | out-string) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ListBox> | |
<ListBox.Template> | |
<ControlTemplate> | |
<!-- Empty template to allow ScrollViewer to capture mouse scroll --> | |
<ItemsPresenter /> | |
</ControlTemplate> | |
</ListBox.Template> | |
</ListBox> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Retarget all loaded projects to the .net version specified in "TargetFramework" | |
// Execute with Visual Commander (https://marketplace.visualstudio.com/items?itemName=SergeyVlasov.VisualCommander) | |
// ********************************************************** | |
// NOTE: NuGet packages need to be reinstalled post execution | |
// ********************************************************** | |
using EnvDTE; | |
using EnvDTE80; | |
using System.Collections.Generic; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Generated a build number in the format year.month.day.buildCounter-story | |
# where story is derived from the branch name | |
# | |
# Parameters are expected in the following order: | |
# 1. build counter | |
# 2. branch name in the format develop | XXXX-ddd | |
param ( | |
[parameter(Mandatory=$true)] [int]$buildCounter, | |
[parameter(Mandatory=$true)] [string]$branch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# modified from sample: https://prettier.io/docs/en/precommit.html | |
# | |
# install dotnet-format: dotnet tool install -g dotnet-format | |
# copy to .git/hooks/pre-commit and make executable | |
# | |
FILES=$(git diff --cached --name-only --diff-filter=ACM "*.cs" | sed 's| |\\ |g') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Maximum carnage. Delete everything in a schema | |
declare | |
V_SCHEMA varchar(100); | |
begin | |
V_SCHEMA := 'APSM'; | |
-- drop queues | |
for R_QUEUE in ( | |
select V_SCHEMA || '.' || NAME as QUEUE_NAME | |
from SYS.ALL_QUEUES |
OlderNewer