Skip to content

Instantly share code, notes, and snippets.

View tjrobinson's full-sized avatar

Tom Robinson tjrobinson

View GitHub Profile
@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
)
@tjrobinson
tjrobinson / MachineKeyBasedEncryptor.cs
Created January 19, 2012 11:25
MachineKeyBasedEncryptor
using System;
using System.IO;
using System.IO.Compression;
using System.Text;
using System.Web;
using System.Web.Security;
public static class MachineKeyBasedEncryptor
{
public static string Encrypt(string value)
@tjrobinson
tjrobinson / gist:1633831
Created January 18, 2012 16:21
Generate EDMX file from Entity Framework Code First Context
// See: http://social.msdn.microsoft.com/Forums/en-US/adonetefx/thread/4aa54da1-3099-48ef-9402-ca94cbca19eb/
builder.DiscoverEntitiesFromContext(typeof(MyContext));
DbModel model = builder.CreateModel();
XmlWriter writer = new XmlTextWriter(Path + "MyContext.edmx", Encoding.UTF8);
model.WriteEdmx(conn, writer);
writer.Close();
@tjrobinson
tjrobinson / Python27.reg
Created January 17, 2012 21:18
Python for Windows registry entries for Windows x64
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python]
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python\PythonCore]
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python\PythonCore\2.7]
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Python\PythonCore\2.7\Help]
using System;
using System.Collections.Generic;
using Microsoft.Synchronization;
using Microsoft.Synchronization.MetadataStorage;
using Microsoft.Synchronization.SimpleProviders;
namespace RemoteStorage
{
/// <summary>
/// Abstract class containing common functionality used by all FullEnumerationSimpleSyncProviders