Skip to content

Instantly share code, notes, and snippets.

<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="Common">
<ReferencePath-FW Include="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.0\*.dll" />
</ItemGroup>
<PropertyGroup>
<ProjectDir>X:\Projects\Costura-Sample\</ProjectDir>
<FodySolutionDir>X:\Projects\Costura-Sample\</FodySolutionDir>
</PropertyGroup>
@dguder
dguder / readassemblycopyright.cs
Created December 10, 2013 16:00
Read assembly copyright version with linq
public string ReadAsmCopyRightInfo(Assembly asm)
{
var asmInfo = String.Empty;
var attr = asm.GetCustomAttributes(false).OfType<AssemblyCopyrightAttribute>().FirstOrDefault();
if (null != attr)
asmInfo = attr.Copyright;
return asmInfo;
}
git for-each-ref refs/remotes/tags --shell --format="r=%(refname:short) t=\${r#tags/}" | while read e; do eval "$e"; git tag -f $t refs/remotes/$r; git branch -d -r $r; done
@dguder
dguder / RunDebugMethod.cs
Created May 7, 2013 08:18
Runs a service from console for debugging
// The main entry point for the process
static void Main()
{
#if (!DEBUG)
System.ServiceProcess.ServiceBase[] ServicesToRun;
ServicesToRun = new System.ServiceProcess.ServiceBase[] { new Service1() };
System.ServiceProcess.ServiceBase.Run(ServicesToRun);
#else
// Debug code: this allows the process to run as a non-service.
// It will kick off the service start point, but never kill it.
@dguder
dguder / Check-Installed-Files.build.xml
Last active December 16, 2015 15:49
Check-Installed-Files.build nant script to check if a msi installer contains all required files Based on discussion in WiX mailing list http://windows-installer-xml-wix-toolset.687559.n2.nabble.com/Wix-layout-tp704688.html
<?xml version="1.0" encoding="utf-8" ?>
<project name="check installer" default="check-installed-files" basedir="." xmlns="http://nant.sf.net/release/0.85-rc3/nant.xsd">
<description>
</description>
<property name="buildarea.dir" value="C:\path\to\buildarea" />
<property name="msitarget.dir" value="_installer" />
<property name="msi.file" value="ProductName.msi" />
@dguder
dguder / compare-folders.cmd
Last active December 16, 2015 15:49
Compare two folders content with diff
diff -qr --ignore-file-name-case <sourcefolder> <targetfolder>