Skip to content

Instantly share code, notes, and snippets.

View jstangroome's full-sized avatar

Jason Stangroome jstangroome

View GitHub Profile
[ಠ_ಠ]
[AttributeUsage(System.AttributeTargets.All, AllowMultiple = true, Inherited = true)]
public class ಠ_ಠAttribute : Attribute
{
public ILog Log { get; set; }
public ಠ_ಠAttribute()
{
Log.Info("This code is bad and you should feel bad");
}
Get-ChildItem -Filter *.csproj -Recurse |
Select-Xml -XPath //b:Reference -Namespace @{b='http://schemas.microsoft.com/developer/msbuild/2003'} |
Select-Object -Property Path,
@{ N='Include'; E={$_.Node.Include} },
@{ N='HintPath'; E={$_.Node.HintPath} } |
Where-Object {
$_.HintPath -ne $null -and
$_.Include -eq "My.Assembly.Name"
} |
Out-GridView
@jstangroome
jstangroome / regex.md
Last active August 29, 2015 13:56 — forked from aaronpowell/regex.md

So I really hate when people use Assert.IsTrue(a == b) as an assertion in a unit test (I blogged my rant) so I decided to find a way to easily convert large test files to be more normal.

Search Regex

You'll want to search with this:

Assert\.IsTrue\((?<Actual>.*)\s*==\s*(?<Expected>.*)\)
//or if your language doesn't support named captures use:
Assert\.IsTrue\((.*)\s*==\s*(.*)\)
$dontcare = git fetch origin --prune
$branches = git branch -a --merged |
?{$_ -match "remotes\/origin"} |
?{$_ -notmatch "\/master"} |
%{$_.Replace("remotes/origin/", "").Trim() }
if (-not $branches) {
echo "No merged branches detected"
exit 0
}
@jstangroome
jstangroome / killscc.ps1
Created March 7, 2011 06:51 — forked from anonymous/killscc.ps1
Strip source control bindings from solution and project files
#requires -version 2.0
param (
[ValidateScript({$_ | Test-Path -PathType Container})]
[Parameter(Mandatory=$true)]
[string] $folder
)
function killScc(){
gci -path $folder -i *.vssscc,*.vspscc -recurse | Remove-Item -force -verbose
}
#requires -version 2.0
[CmdletBinding()]
param (
[parameter(Mandatory=$true)]
[ValidateScript({ $_ | Test-Path -PathType Leaf })]
[string]
$Path
)
#requires -Version 2
[CmdletBinding()]
param (
[parameter(
Mandatory=$true,
ValueFromPipeline=$true,
ValueFromPipelineByPropertyName=$true
)]
[string[]]