This file contains hidden or 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
| <Activity x:Class="TfsBuild.Process" xmlns="http://schemas.microsoft.com/netfx/2009/xaml/activities" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mt="clr-namespace:Microsoft.TeamFoundation;assembly=Microsoft.TeamFoundation.Common" xmlns:mtbc="clr-namespace:Microsoft.TeamFoundation.Build.Client;assembly=Microsoft.TeamFoundation.Build.Client" xmlns:mtbco="clr-namespace:Microsoft.TeamFoundation.Build.Common;assembly=Microsoft.TeamFoundation.Build.Common" xmlns:mtbw="clr-namespace:Microsoft.TeamFoundation.Build.Workflow;assembly=Microsoft.TeamFoundation.Build.Workflow" xmlns:mtbwa="clr-namespace:Microsoft.TeamFoundation.Build.Workflow.Activities;assembly=Microsoft.TeamFoundation.Build.Workflow" xmlns:mtba="clr-namespace:Microsoft.TeamFoundation.Build.Activities;assembly=Microsoft.TeamFoundation.Build.Activities" xmlns:mtbac="clr-namespace:Microsoft.TeamFoundation.Build.Activities.Core;assembly=Microsoft.TeamFoundation.Build.Activities" xmlns:mtbag="clr-namespace:Microsoft.TeamFound |
This file contains hidden or 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
| Task flushingTask = null; | |
| public override Task FlushAsync(CancellationToken cancellationToken) | |
| { | |
| Interlocked.CompareExchange( | |
| ref flushingTask, | |
| Task.Delay(200, cancellationToken).ContinueWith( | |
| async (t) => | |
| { | |
| await write.FlushAsync(cancellationToken); |
This file contains hidden or 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
| ruby_block "create ssh key" do | |
| block do | |
| k = SSHKey.generate(:type => 'RSA', :bits => 1024, :comment => "Postgres Master") | |
| node.set[:postgresql][:pubkey] = k.ssh_public_key | |
| node.save | |
| # Much of the DSL disappears in ruby blocks. Here's how to create a template. | |
| rc = Chef::RunContext.new(node, node.cookbook_collection) | |
| t = Chef::Resource::Template.new "/var/lib/postgresql/.ssh/id_rsa" | |
| t.source("id_rsa.erb") |
This file contains hidden or 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 | |
| :: http://stackoverflow.com/questions/328017/path-to-msbuild | |
| :: http://www.csharp411.com/where-to-find-msbuild-exe/ | |
| :: http://timrayburn.net/blog/visual-studio-2013-and-msbuild/ | |
| :: http://blogs.msdn.com/b/visualstudio/archive/2013/07/24/msbuild-is-now-part-of-visual-studio.aspx | |
| setlocal | |
| :vswhereModernTry | |
| :: https://github.com/Microsoft/vswhere/wiki/Find-MSBuild | |
| :: Normal output example of `vswhere -legacy -latest -property installationPath` has no trailing back-slash: |
This file contains hidden or 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; | |
| using System.Collections.Immutable; | |
| using System.Linq; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| using HellBrick.Diagnostics.UnusedReferences; | |
| using Microsoft.CodeAnalysis; | |
| using Microsoft.CodeAnalysis.Diagnostics; | |
| using Microsoft.CodeAnalysis.MSBuild; |
This file contains hidden or 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
| public class DistributedMutex { | |
| private readonly string key; | |
| private readonly string storageConnectionString; | |
| private readonly string storageContainerName; | |
| private CloudBlobClient blobClient; | |
| private string leaseId; | |
| public DistributedMutex(string storageConnectionString, string storageContainerName, string key) | |
| { | |
| this.key = key; |
This file contains hidden or 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
| // intended to be called only ONCE in real installations - or for a clean test run when no Jobs container exists | |
| public static void GloballyInitializeJobManager(bool quiet) | |
| { | |
| var blobContainer = AzureStorageAccess.GetBlobContainer(JobContainerName); | |
| bool didNotExistCreated = blobContainer.CreateIfNotExist(); | |
| if (!quiet) System.Diagnostics.Debug.Assert(didNotExistCreated); // else, we probably should not be calling this method | |
| var blob = blobContainer.GetBlobReference(JobGlobalJobIdSequencePath); | |
| if (!blob.Exists()) | |
| { | |
| blob.UploadText(JobGlobalJobIdSequenceStartingValue); |
This file contains hidden or 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
| Import-Module "sqlps" | |
| $smo = 'Microsoft.SqlServer.Management.Smo.' | |
| $wmi = new-object ($smo + 'Wmi.ManagedComputer'). | |
| # List the object properties, including the instance names. | |
| $Wmi | |
| # Enable the TCP protocol on the default instance. | |
| $uri = "ManagedComputer[@Name='" + (get-item env:\computername).Value + "']/ServerInstance[@Name='MSSQLSERVER']/ServerProtocol[@Name='Tcp']" | |
| $Tcp = $wmi.GetSmoObject($uri) |
This file contains hidden or 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.Threading; | |
| using System.Threading.Tasks; | |
| using System.Threading.Tasks.Dataflow; | |
| namespace TDFDemo | |
| { | |
| class Program | |
| { |
This file contains hidden or 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
| package main | |
| import ( | |
| "fmt" | |
| "time" | |
| "sync" | |
| ) | |
| func main() { | |
| wg := &sync.WaitGroup{} |
OlderNewer