Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am MechMK1 on github.
  • I am mechmk1 (https://keybase.io/mechmk1) on keybase.
  • I have a public key whose fingerprint is F41A FA8B 9691 F516 A1B0 C6C7 E886 9F7B 70BD DFB0

To claim this, I am signing this object:

@MechMK1
MechMK1 / 01Basics.cs
Last active August 29, 2015 14:15
LINQ Overview
static void Main(string[] args)
{
// Let us define some data in an IEnumerable<T>
List<int> data = new List<int> { 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89 };
// Let's define a simple query
var query = from i in data
where i > 10
select i;
@MechMK1
MechMK1 / gist:ca08d51fc936988b7b8a
Created February 17, 2015 15:41
C# Singletons
class Singleton
{
//Private static field to hold the instance
private static Singleton _singleton = null;
// Getter for the instance
public static Singleton Instance
{
get
{
@MechMK1
MechMK1 / flags.sh
Created December 25, 2014 10:43
Framework for flags in bash scripts
while test $# -gt 0; do
case "$1" in
-h|--help)
echo "$0 [options] something"
echo " "
echo "options:"
echo " -h, --help show brief help"
echo " -a, --action=ACTION specify an action to use"
echo " -o, --output-dir=DIR specify a directory to store output in"
exit 0
@MechMK1
MechMK1 / addSVN.sh
Created December 25, 2014 00:38
Quickly create a new SVN repository and make it accessible via WebDAV
#!/bin/bash
#CFG
#Paths to directories must NOT end with /
SVNPARENT="/var/svn"
APACHECFG="/etc/apache2"
APACHESVN="/etc/apache2/svn"
USEMASTER=false #Prefer individual set to true to always use master or use -m to change individually
MASTERPASSWD="${APACHESVN}/master.passwd"
MASTERREALM="REALM" #Change