Skip to content

Instantly share code, notes, and snippets.

View mkchandler's full-sized avatar

Matt Chandler mkchandler

View GitHub Profile
@mkchandler
mkchandler / Setting up SourceGear DiffMerge for Git.md
Last active January 13, 2022 10:44
Setup guide for making Git recognize and use SourceGear DiffMerge.
  1. Download SourceGear DiffMerge: http://sourcegear.com/diffmerge/index.html

  2. Add the following to your global .gitconfig file:

     [diff]
         tool = DiffMerge
     [difftool "DiffMerge"]
         cmd = 'C:/Program Files/SourceGear/Common/DiffMerge/sgdm.exe' "$LOCAL" "$REMOTE"
     [merge]
    

tool = DiffMerge

@mkchandler
mkchandler / ReadSerialPort.cs
Created December 15, 2012 23:41
Some C# code to read a serial port. Using this as a starting point for an Arduino project.
using System;
using System.IO.Ports;
namespace SerialReader
{
class Program
{
static void Main(string[] args)
{
var reader = new ArduinoSerialReader("COM3");
@mkchandler
mkchandler / DisableNuGetPackageRestore.ps1
Last active February 13, 2018 04:07
Disable the NuGet Package Restore functionality in a Visual Studio solution.
# Usage: .\DisableNuGetPackageRestore.ps1 C:\Path\To\Solution.sln
# Get the path that the user specified when calling the script
$solution = $args[0]
$solutionPath = Split-Path $solution -Parent
$solutionName = Split-Path $solution -Leaf
# Delete the .nuget directory and all contents
Remove-Item (Join-Path $solutionPath ".nuget") -Force -Recurse -ErrorAction 0
@mkchandler
mkchandler / ActiveDomainControllers.cs
Created February 25, 2014 16:32
Gets a list of all available domain controllers or find a single available controller.
using System;
using System.DirectoryServices.ActiveDirectory;
namespace ActiveDomainControllers
{
public class Program
{
public static void Main(string[] args)
{
// Get a list of all available domain contollers