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
[user] | |
name = Toby Qin | |
email = toby.qin@live.com | |
[alias] | |
lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(bold magenta)%d%Creset %s %Cgreen(%cr)%C(bold cyan)<%an>%Creset' --abbrev-commit | |
l = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%C(cyan)\\ [%cn]" --decorate --date=short -20 | |
ci = commit --verbose | |
ca = commit -a --verbose | |
cm = commit -m |
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
using System; | |
using System.Collections.Generic; | |
namespace QuickSortTest | |
{ | |
internal class QuickSortTest | |
{ | |
/// <summary> | |
/// Quick sort algorithm implement | |
/// </summary> |
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
@echo off | |
set "targetDir=%~dp0..\" | |
set nuget=%~dp0..\Tools\@Executable\nuget.exe | |
echo ========================================= | |
echo Restore Nuget packages for all solutions. | |
echo. | |
echo In Path: %targetDir% | |
echo By Tool: %nuget% | |
echo ========================================= | |
echo. |
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
@echo off | |
set "targetDir=%~dp0..\" | |
set nuget=%~dp0..\Tools\@Executable\nuget.exe | |
echo ========================================= | |
echo Restore Nuget packages for all solutions. | |
echo. | |
echo In Path: %targetDir% | |
echo By Tool: %nuget% | |
echo ========================================= | |
echo. |
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
Function Get-DiskInfo | |
{ | |
Param( | |
$ComputerName = $env:COMPUTERNAME, | |
[Switch]$PassThru | |
) | |
Function Get-ColorSplat | |
{ | |
# Create color Splats |
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
#Add TimeStamp | |
$thedate = Get-Date -format "yyyy-MM-dd" | |
$logfile = "OpenWebPage" + "$thedate" + ".txt" | |
$thefiledate = Get-Date -format "yyyy-MM-dd HH:mm:ss" | |
Add-Content $logfile "`nTime Started(yyyyMMddHHmm) $thefiledate " | |
$urlsplit = "http://weburl:8629/path".Split(':') | |
$portsplit = ":8629/path" | |
$urlport = $urlsplit[0] + ":" + $urlsplit[1] + $portsplit | |
$fport = $urlport + "query?value=test" |
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
function Block-Processes ($pattern) | |
{ | |
# $pattern=@("Spirit.*") | |
$proc = Get-Process -Name $pattern | |
foreach($p in $proc) | |
{ | |
if($p -ne $null) | |
{ | |
Stop-Process $p.Id -Force | |
} |
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
:: Restore nuget packages | |
set nuget="%~dp0\Tools\nuget.exe" | |
pushd "%~dp0" | |
%nuget% restore MyApp.sln | |
popd |
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
function Start-TheService([string]$svc) | |
{ | |
$STOP = "Stopped" | |
$RUN = "Running" | |
"Starting $svc..." | |
$s = get-service -name $svc | |
"Original status is : " + $s.Status | |
if($s.Status -eq $STOP) |
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
function Get-LogDir($env) | |
{ | |
$dir = $globalConf.LogDir | |
New-Item -Path $dir -ItemType "Directory" -Force | Out-Null | |
return $dir | |
} | |
function Init-LogFile($env, $stepName) | |
{ | |
$logDir = Get-LogDir $env |