Skip to content

Instantly share code, notes, and snippets.

View TimMurphy's full-sized avatar

Tim Murphy TimMurphy

View GitHub Profile
@TimMurphy
TimMurphy / LibLogLogger
Created September 19, 2014 22:24
Anotar.Custom implementation for LibLog
public class LibLogLogger
{
private readonly ILog Logger;
public LibLogLogger(ILog logger)
{
Logger = logger;
}
public bool IsDebugEnabled
@TimMurphy
TimMurphy / App.config
Last active June 30, 2016 08:47
.NET solution
<configSections>
<section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog" />
</configSections>
<nlog throwExceptions="false" xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<time type="AccurateUTC" />
<targets>
<target xsi:type="Chainsaw" name="Chainsaw" address="udp://127.0.0.1:7071" />
<target xsi:type="Trace" name="Trace" layout="NLog | ${level:padding=5} | ${logger} | ${message}" />
</targets>
@TimMurphy
TimMurphy / Boxstarter
Last active August 29, 2015 14:07
Boxstarter scripts
Enable-MicrosoftUpdate
Install-WindowsUpdate -AcceptEula
Set-StartScreenOptions -EnableBootToDesktop -EnableDesktopBackgroundOnStart -EnableShowStartOnActiveScreen -DisableShowAppsViewOnStartScreen -DisableSearchEverywhereInAppsView -EnableListDesktopAppsFirst
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -DisableShowProtectedOSFiles -EnableShowFileExtensions -DisableShowFullPathInTitleBar
Enable-RemoteDesktop
cinst Microsoft-Hyper-V-All -source windowsFeatures
@TimMurphy
TimMurphy / .gitconfig
Last active August 29, 2015 14:07
Git Aliases
[alias]
# References
# ----------
#
# - http://haacked.com/archive/2014/07/28/github-flow-aliases/
# update working copy before creating new branch
update = !git pull --rebase --prune $@ && git submodule update --init --recursive
@TimMurphy
TimMurphy / Test.csproj
Last active August 29, 2015 14:08
C# Test project
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
...
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
...
</PropertyGroup>

To follow is my standard layout for .NET projects. It is a modification of David Fowler's dotnetlayout.md gist

$/
  artifacts/
  build/
  dependencies/
  docs/
  packages/
 samples/
The following scripts are used by [Boxstarter](http://boxstarter.org/) to configure my Azure virtual machines.
<configSections>
<section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog" />
<sectionGroup name="common">
<section name="logging" type="Common.Logging.ConfigurationSectionHandler, Common.Logging" />
</sectionGroup>
</configSections>
<common>
<logging>
<factoryAdapter type="Common.Logging.NLog.NLogLoggerFactoryAdapter, Common.Logging.NLog31">
var sb = new StringBuilder();
var properties = error.GetType().GetProperties();
foreach (var propertyInfo in properties)
{
sb.AppendLine(string.Format("public {0} {1} {{ get; set; }}", propertyInfo.PropertyType.Name, propertyInfo.Name));
}
foreach (var propertyInfo in properties)
{
@TimMurphy
TimMurphy / boxstarter-buildservertmit.ps1
Last active September 21, 2015 20:00
Boxstarter script for buildservertmit
Function Main()
{
Enable-MicrosoftUpdate
Install-WindowsUpdate -AcceptEula
Install-Packages
Write-Host "Importing Carbon module..."
& "C:\Program Files\WindowsPowerShell\Modules\Carbon\Import-Carbon.ps1"