Skip to content

Instantly share code, notes, and snippets.

View kujotx's full-sized avatar

Kurt Johnson kujotx

View GitHub Profile
@jageall
jageall / SemverSort.ps1
Last active March 15, 2022 19:09
Sorts semver in powershell
#powershell script port of https://github.com/maxhauser/semver/
function toSemVer($version){
$version -match "^(?<major>\d+)(\.(?<minor>\d+))?(\.(?<patch>\d+))?(\-(?<pre>[0-9A-Za-z\-\.]+))?(\+(?<build>[0-9A-Za-z\-\.]+))?$" | Out-Null
$major = [int]$matches['major']
$minor = [int]$matches['minor']
$patch = [int]$matches['patch']
if($matches['pre'] -eq $null){$pre = @()}
else{$pre = $matches['pre'].Split(".")}
@lefthandedgoat
lefthandedgoat / gist:9126142
Last active September 4, 2019 13:20
How to embed images for failed tests in Team City (using canopy)
//first read about how to do something similar here:
http://atombrenner.blogspot.com/2012/09/embed-url-links-in-teamcity-build-logs.html
//plugin location
http://confluence.jetbrains.com/display/TW/StaticUIExtensions
//download at:
http://teamcity.jetbrains.com/repository/download/TeamCityPluginsByJetBrains_StaticUiExtensionsAgainstTeamCity8/latest.lastSuccessful/static-ui-extensions.zip
//after downloading you can go to you team city administrator, go to plugins, and upload the one you just downloaded
//restart TC web server so that it registers the plugin, once you go back you should have 1 more
@zippy1981
zippy1981 / DefaultConfig.reg
Last active December 16, 2015 18:19
Here are some functions for setting Visual Studio Merge tools via the registry.
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0_Config\TeamFoundation\SourceControl]
[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0_Config\TeamFoundation\SourceControl\Checkin Policies]
"Microsoft.TeamFoundation.Build.Controls"="C:\\Program Files (x86)\\Microsoft Visual Studio 11.0\\\\Common7\\IDE\\PrivateAssemblies\\Microsoft.TeamFoundation.Build.Controls.dll"
"Microsoft.TeamFoundation.VersionControl.Controls"="C:\\Program Files (x86)\\Microsoft Visual Studio 11.0\\\\Common7\\IDE\\PrivateAssemblies\\Microsoft.TeamFoundation.VersionControl.Controls.dll"
"StanPolicy"="C:\\Program Files (x86)\\Microsoft Visual Studio 11.0\\Team Tools\\Static Analysis Tools\\StanPolicy.dll"
[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0_Config\TeamFoundation\SourceControl\DiffTools]
@sayedihashimi
sayedihashimi / get-full-path.proj
Created December 23, 2012 23:06
Demonstrates how you can convert a relative path to an absolute path in MSBuild
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Demo">
<!-- Demonstrates how you can convert a relative path to a full path in MSBuild -->
<PropertyGroup>
<Filepath>sample\file.txt</Filepath>
</PropertyGroup>
<Target Name="Demo">
<PropertyGroup>
@ferventcoder
ferventcoder / InstallChocolatey.cmd
Created April 2, 2012 21:38
Chocolatey One Line Install from the command line
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('http://bit.ly/psChocInstall'))";
@bwiggs
bwiggs / DebuggingMacros.vb
Created November 29, 2011 22:16
DebuggingMacros.vb
' original code from Ingo Rammer (http://weblogs.thinktecture.com/ingo/2011/02/attach-to-process-macro-for-visual-studio-2010.html)
' ===== Create the Macro =====
' 1. Tools > Macros > Macro IDE
' 2. Right Click MyMacros > Add > Add Module
' 3. Paste in the code below:
' 4. Rename the Macro file DebuggingMacros
' ==== Add Macros to Debug Toolbar ====
Fluently.Configure()
.Mappings(...)
.Database(...)
.Diagnostics(dia =>
{
dia.Enable();
dia.OutputToConsole();
})
.BuildSessionFactory();
@nkohari
nkohari / linq.js
Created September 26, 2009 20:13
linq.js
/*
linq.js -- a simple LINQ implementation for javascript
Author: Nate Kohari <nate@enkari.com>
Copyright (C) 2009 Enkari, Ltd.
Released under the Apache 2.0 license (http://www.opensource.org/licenses/apache2.0.php)
*/
Array.prototype.all = function(func) {
var result = true;
this.iterate(function(item) {