Skip to content

Instantly share code, notes, and snippets.

View tjrobinson's full-sized avatar

Tom Robinson tjrobinson

View GitHub Profile
@tjrobinson
tjrobinson / Web.config
Created July 2, 2014 12:57
Defining a redirect/rewrite in the Web.config
<?xml version="1.0"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Index Request" enabled="true" stopProcessing="true">
<match url="^$"/>
<action type="Rewrite" url="App/app.html" logRewrittenUrl="true"/>
</rule>
</rules>
@tjrobinson
tjrobinson / StandardNoStopWordsAnalyser.cs
Last active August 29, 2015 14:01
Upgrade from Lucene.NET 3 to Lucene.NET 4.0
public class StandardNoStopWordsAnalyser : StandardAnalyzer
{
public StandardNoStopWordsAnalyser() : base(Version.LUCENE_29, new HashSet<string>()) { }
}
input {
tcp {
type => "eventlog"
host => "10.1.1.2"
port => 3515
format => 'json'
}
}
@tjrobinson
tjrobinson / nuget-usage.ps1
Created August 2, 2013 08:45
Find NuGet packages across multiple solutions
$packagesInUse = @()
[xml] $nugetConfig = [xml](Get-Content nuget.config)
[System.Xml.XmlElement] $nugetConfigRoot = $nugetConfig.get_DocumentElement()
$repositoryPath = $nugetConfigRoot.SelectSingleNode("repositoryPath").InnerText
Write-Host "repositoryPath:" $repositoryPath
[xml] $repositories = [xml](Get-Content $repositoryPath\repositories.config)
[System.Xml.XmlElement] $repositoriesRoot = $repositories.get_DocumentElement()
@tjrobinson
tjrobinson / gist:5151618
Last active December 14, 2015 21:29
Get TODOs
$head = "<style>
body {
color: #151515;
font-family: helvetica neue,arial,sans-serif;
font-size: 82%;
line-height: 1.5em;
text-rendering: optimizelegibility;
}
th {
text-align: left;
@tjrobinson
tjrobinson / gist:5117565
Created March 8, 2013 16:12
AppDomain.CurrentDomain.AssemblyResolve
AppDomain.CurrentDomain.AssemblyResolve += (s, ea) => ea.Name.StartsWith("NHibernate,") ? Assembly.GetAssembly(typeof(NHibernate.ISession)) : null;
@tjrobinson
tjrobinson / svn-ignore
Created January 2, 2013 11:16
Subversion global ignores
### Set global-ignores to a set of whitespace-delimited globs
### which Subversion will ignore in its 'status' output, and
### while importing or adding files and directories.
global-ignores = *.o *.lo *.la #*# .*.rej *.rej .*~ *~ .#* .DS_Store *.dat bin Bin obj Obj *.user *.suo *.sln.cache *.xap licences.licx licenses.licx _ReSharper.* *.resharper* *.g.cs ~$* StyleCop.Cache *.DotSettings
@tjrobinson
tjrobinson / runwithpowershell.reg
Created November 7, 2012 14:02
Run with PowerShell
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\Shell\Run with PowerShell]
[HKEY_CLASSES_ROOT\*\Shell\Run with PowerShell\command]
@="C:\\Windows\\system32\\WindowsPowerShell\\v1.0\\powershell.exe -NoExit &'%1'"
@tjrobinson
tjrobinson / gist:3046352
Created July 4, 2012 09:31
PowerShell CmdLet in C#
using System.Management.Automation;
[Cmdlet(VerbsCommon.Get, "HelloWorld")]
public class GetHelloWorld : Cmdlet
{
protected override void ProcessRecord()
{
base.ProcessRecord();
WriteObject("HelloWorld");
}
@tjrobinson
tjrobinson / SubversionTests.ps1
Created May 17, 2012 08:02
Subversion Tests
# Usage: cd \; . c:\SubversionTests.ps1; BranchingTest1
function Create-LocalRepository
{
param
(
[string]$basePath,
[string]$repositoryName
)