Skip to content

Instantly share code, notes, and snippets.

Avatar

Nathan Jones nathanpjones

View GitHub Profile
View Input-Output-Go-WPF-GUI-Template.linq
enum TextBoxMode
{
SingleLine,
MultiLine
}
TextBox CreateTextBox(string label, TextBoxMode textBoxMode)
{
var lbl = new Label();
lbl.Content = $"{label}:";
View python_as_pi.sh
#!/usr/bin/env bash
DIR=$(dirname $(readlink -f "${BASH_SOURCE}"))
if [ ! -f $DIR/venv/bin/python ]; then
echo "This script should be located in the project root directory"
echo "and the virtual environment should be created."
else
# Change python back to run as pi
@nathanpjones
nathanpjones / GitDiff.sh
Last active Oct 20, 2016
Git script to route diff handling to different applications based on file extension
View GitDiff.sh
#!/bin/sh
NULL="/dev/null"
# $1 = $LOCAL
# $2 = $REMOTE
# $3 = $MERGED
# get file extension in lowercase for selecting comparison tool
filename=$(basename "$1")
extension=$(echo "${filename##*.}" | awk '{print tolower($0)}');
View Example.cs
/*
* This is an example console application to illustrate the usage
* of the MonitoredLock class and technique.
*/
using System;
using System.Diagnostics;
using System.Threading;
namespace MonitoredLock
{