Skip to content

Instantly share code, notes, and snippets.

View mletterle's full-sized avatar
💭
🍺 Always. Be. Coding.

Michael Letterle mletterle

💭
🍺 Always. Be. Coding.
View GitHub Profile

Keybase proof

I hereby claim:

  • I am mletterle on github.
  • I am mletterle (https://keybase.io/mletterle) on keybase.
  • I have a public key whose fingerprint is 3762 9171 ABB9 A148 0970 1795 4AAF 5557 B73F 2193

To claim this, I am signing this object:

@mletterle
mletterle / gist:8048086
Last active November 26, 2021 08:56
Replay Two Git Repositories History Into A New One, Chronologically

Combining Two (or more potentially) Git Repos

###Moving one repo into a subdirectory of the other

Preserves notes and sets commit details to author details

in newrepo

@mletterle
mletterle / git-tfs rcheckin prepare-commit-msg hook
Last active December 27, 2015 14:39
Handy little hook I think...
#!/bin/bash
branchname=`git symbolic-ref -q --short HEAD`
if [[ $branchname =~ 'tfs-.*' ]]; then
workitems=$(echo $branchname | sed s/tfs-//g | tr ',' ' ' )
for workitem in $workitems;
do
cp $1 $1.old
$(sed '1s/^/#git-tfs-work-item: '$workitem' associate\n/' $1.old > $1)
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
.assembly Test { }
.class public TestClass
extends [mscorlib]System.Object
{
.method specialname static public void Main() cil managed
{
.entrypoint
newobj instance void AnotherClass2::.ctor()
dup
lock(something)
{
try
{
if(foo) { Bar(); }
else { Baz(); }
}
catch
{
Bampf();
public class Foo
{
private baz a;
private baz b;
private baz c;
public void Bar(Fargle f)
{
irb(main):001:0> a = [1, 2, 3]
=> [1, 2, 3]
irb(main):002:0> a[1]
=> 2
irb(main):003:0> a[0] + 1
=> 2
irb(main):004:0> a[1] + 1
=> 3
irb(main):005:0> a = ["1", "2", "3"]
=> ["1", "2", "3"]
namespace Test
{
class Test
{
public delegate void MyDelegate();
public void TestMethod()
{
TestMethod2( delegate()
{
goto outLabel;
class Program
{
static void Main(string[] args)
{
string s = "foo";
Action result =
s == "bar" ? (Action)(() => { Console.WriteLine("bar"); }):
s == "foo" ? (Action)(() => { Console.WriteLine("foo"); }) :
(Action)(() => { Console.WriteLine(); });