Skip to content

Instantly share code, notes, and snippets.

View refactorsaurusrex's full-sized avatar

refactorsaurusrex

View GitHub Profile
@refactorsaurusrex
refactorsaurusrex / Program.cs
Last active April 23, 2016 02:51
Lists all currently running IIS applications, along with their app pool names and process ids.
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ListAllWebApps
{
class Program
@refactorsaurusrex
refactorsaurusrex / Program.cs
Created May 29, 2015 04:54
Super simple C# script to zip up build artifacts for a project in the same solution, give the zip file a sequential, version specific name, and add it to a specific directory.
using System;
using System.Collections.Generic;
using System.IO;
using System.IO.Compression;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
@refactorsaurusrex
refactorsaurusrex / DeleteLocalGitBranches.ps1
Last active August 18, 2016 14:31
Delete all local git branches
function Delete-LocalBranches ($Commit = 'HEAD', [switch]$Force) {
git branch |
? { $_ -notmatch '(^\*)|(^. master$)' } |
% { git branch $(if($Force) { '-D' } else { "-d" }) $_.Substring(2) }
}
@refactorsaurusrex
refactorsaurusrex / WPFZoomImageOnLoad1.xml
Last active August 29, 2015 14:16
WPF: Zoom In An Image On Application Load
<!-- Assume a data context with all the appropriate bindings -->
<Window
<Window.InputBindings>
<KeyBinding Key="Up" Command="{Binding ZoomIn}" />
<KeyBinding Key="Down" Command="{Binding ZoomOut}" />
</Window.InputBindings>
<Grid>
<Image Source="{Binding MyPath}" HorizontalAlignment="Center"
VerticalAlignment="Center" Width="{Binding DisplayedWidth}" >
<Image.Triggers>