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
<?xml version="1.0" encoding="utf-8"?> | |
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<UsingTask TaskName="GitVersion" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll" > | |
<ParameterGroup> | |
<LocalPath ParameterType="System.String" /> | |
<Path ParameterType="System.String" /> | |
<CommitCount ParameterType="System.Int32" Output="true" /> | |
</ParameterGroup> | |
<Task> |
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.Diagnostics; | |
using System.Net; | |
namespace ConsoleApplication1 { | |
internal class Program { | |
private const int COUNT = 20; | |
private static void Main() { | |
var urls = new[] { |
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.Concurrent; | |
using System.Collections.Generic; | |
using System.Threading; | |
using System.Threading.Tasks; | |
namespace SingleThreadedTaskSchedulerDemo { | |
public class SingleThreadedTaskScheduler : TaskScheduler, IDisposable { | |
private readonly string _backgroundThreadName; | |
private readonly object _backgroundThreadLock = new object(); |
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-NuGetPackageFolder { | |
param( | |
[string] $package_name, | |
[string] $nuget_packages_config | |
) | |
$xml = [xml](gc $nuget_packages_config) | |
$package = $xml.packages.package | where { $_.id -eq $package_name } | |
Join-Path $packages_dir ($package_name + "." + $package.version) | |
} |
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
# Helper script for those who want to run psake without importing the module. | |
# Example: | |
# .\psake.ps1 "default.ps1" "BuildHelloWord" "4.0" | |
# Must match parameter definitions for psake.psm1/invoke-psake | |
# otherwise named parameter binding fails | |
param( | |
[Parameter(Position=0,Mandatory=0)] | |
[string]$buildFile = 'default.ps1', | |
[Parameter(Position=1,Mandatory=0)] |
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 Expand-ZipFile { | |
param { | |
$zipPath, | |
$destination, | |
[switch] $quiet | |
} | |
$shellApplication = new-object -com shell.application | |
$zipPackage = $shellApplication.NameSpace($zipPath) | |
$destinationFolder = $shellApplication.NameSpace($destination) |
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
<# | |
.SYNOPSIS | |
Adds an XML fragment to an XmlNode | |
.DESCRIPTION | |
Adds an XML fragment to an XmlNode | |
.NOTES | |
Author : Thomas Freudenberg - info@thomasfreudenberg.com | |
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
<?xml version="1.0" encoding="utf-8" ?> | |
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<UsingTask | |
TaskName="GetVersion" | |
TaskFactory="CodeTaskFactory" | |
AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll" > | |
<ParameterGroup> | |
<VersionString ParameterType="System.String" Required="true" /> | |
<Version ParameterType="System.String" Output="true" /> |
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
# red background if running elevated | |
& { | |
$wid=[System.Security.Principal.WindowsIdentity]::GetCurrent() | |
$prp=new-object System.Security.Principal.WindowsPrincipal($wid) | |
$adm=[System.Security.Principal.WindowsBuiltInRole]::Administrator | |
$IsAdmin=$prp.IsInRole($adm) | |
if ($IsAdmin) | |
{ | |
(get-host).UI.RawUI.Backgroundcolor="DarkRed" | |
clear-host |
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
<?xml version="1.0" encoding="utf-8" ?> | |
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | |
<!-- | |
Originally written by Daniel Chambers (http://www.digitallycreated.net) | |
http://www.digitallycreated.net/Blog/61/combining-multiple-assemblies-into-a-single-exe-for-a-wpf-application | |
--> | |
<Target Name="EmbedReferencedAssemblies" AfterTargets="ResolveAssemblyReferences"> | |
<ItemGroup> | |
<!-- get list of assemblies marked as CopyToLocal --> | |
<AssembliesToEmbed Include="@(ReferenceCopyLocalPaths)" Condition="'%(Extension)' == '.dll'"/> |
OlderNewer