Skip to content

Instantly share code, notes, and snippets.

@Novakov
Novakov / merge.ps1
Last active February 17, 2016 15:37
TFS Powershell scripts
param([string]$repo, [string]$source,[string]$dest)
$base = "$/MAPS Onboard/Dev/$repo"
set-alias tf 'C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\TF.exe'
tf get /recursive "$base/$source"
tf merge /recursive "$base/$source" "$base/$dest"
using System;
using System.Collections;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
namespace WaitableBitSetTest
{
class Program
{
@Novakov
Novakov / gist:8055374
Created December 20, 2013 14:17
C# pipeline written using | operator - like command line
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
namespace PipelineOperators
{
class Program
Task InstallEventStore {
echo "Installing EventStore service from $($eventStoreBin)"
$srvAnyPath = [System.IO.Path]::Combine($(Get-Location), '..\tools\srvany.exe')
New-Service -Name EventStore -BinaryPathName $srvAnyPath -DisplayName EventStore -StartupType Manual | Out-Null
New-Item HKLM:\SYSTEM\CurrentControlSet\services\EventStore\Parameters -ItemType Key | Out-Null
void fc_transmit_and_wait(unsigned char buffer[TX_PLOAD_WIDTH])
{
fc_transmit(buffer);
while(1)
{
unsigned char status = 0;
NRFRead(STATUS, &status, 1);
@Novakov
Novakov / PatternMatching.cs
Last active August 29, 2015 14:03
Having fun with collection initializer in C#
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
namespace PatternMatch
{
class Program
{
static void Main(string[] args)
function time(totalSeconds){
var seconds = parseInt(totalSeconds % 60);
var minutes = parseInt(totalSeconds / 60) % 60;
var hours = parseInt(totalSeconds / 3600);
return hours + ':' + minutes + ':' + seconds;
}
setInterval(function(){
if(window.target == 0) {
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
class Class1
{
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.CodeRefactorings;
using Microsoft.CodeAnalysis.Formatting;
namespace RefactoringEssentials.CSharp.CodeRefactorings
[CmdletBinding()]
param(
[Parameter(Mandatory)]
[string]$VMName,
[Parameter(Mandatory)]
[string]$OutputFile
)
function Get-DriveType($drive)