Skip to content

Instantly share code, notes, and snippets.


Tom Kuijsten tomkuijsten

View GitHub Profile
View CSharpDelegates.cs
// This is all pseudo code, never tested, just to give a quick idea of a delegate
// Just like you use the "class" keyword to define the characteristic of an object, you can use
// "delegate" to define the characteristic of a method.
public delegate void PerformDatabaseAction(SqlConnection sqlConn);
public static class DatabaseHelpers
public static void DoDatabaseAction(PerformDatabaseAction theDbAction)
View CSharpKeyWords - Part1 - abstract-virtual-override-new.cs
using System.Collections.Generic;
using System.Linq;
using System;
public static class Program
public static void Main()
var dogs = new List<Dog>();
dogs.Add(new Dalmatier());
tomkuijsten / Convert-ToPackageReference.ps1
Created Sep 7, 2017 — forked from a4099181/Convert-ToPackageReference.ps1
Converts packages.config into PackageReference at *.csproj project file. Requires XSLT stylesheet available as second file in the gist.
View Convert-ToPackageReference.ps1
Function Convert-ToPackageReference
Param ( [Parameter( Mandatory, ValueFromPipeline )][String] $inputUri,
[String] $stylesheetUri = "",
[String] $resultsFile = [System.IO.Path]::GetTempFileName() )
Process {
$xslt = New-Object System.Xml.Xsl.XslCompiledTransform
$xslt.Load( $stylesheetUri )
$xslt.Transform( $inputUri, $resultsFile )
tomkuijsten / RedirectUsingQueryParameter.html
Last active Oct 18, 2016
Html which redirects to another url based on query param
View RedirectUsingQueryParameter.html
<script type="text/javascript">
// stolen from:
// http://minwinpc/RedirectUsingQueryParameter.html?selection=a
function getQueryStringArray(){
var assoc=[];
var items ='&');
for(var j = 0; j < items.length; j++) {
View TFSAggregator.LastRevisionTest.cs
if(self.Revision == 0)
// without history, we can't do anything
logger.Log("There is not history for this task, quit.");
return null;
var treatStates = new[] {"In Progress", "Review"};
var stateKey = "System.State";
var currentState = (string)self.Fields[stateKey].Value;
View TFSAggregator.Samples.xml
<rule name="AutoOpen" appliesTo="Task">
<!-- Update Work Item to Committed if a task became "active" -->
if (new[] {"In Progress", "To Do"}.Contains((string)self["System.State"]))
if(self.HasParent() && (string)self.Parent["System.State"] != "Committed")
self.Parent.TransitionToState("Committed", "Auto Activated");
View UpdateStates.policy.xml
<?xml version="1.0" encoding="utf-8"?>
<!-- Configure TFS Aggregator behavior. (Once, Optional)
- **debug**: turns on debugging options (Optional, default: False)
<runtime debug="false">