Skip to content

Instantly share code, notes, and snippets.

View dahlbyk's full-sized avatar

Keith Dahlby dahlbyk

View GitHub Profile
@dahlbyk
dahlbyk / gist:a8c63276536b94c463a7
Created November 1, 2014 21:58
Midwest Community Opportunities
Conferences
===========
Heartland Developer Conference in Omaha ~ September
Kansas City Developer Conf ~ June says Darin
St Louis Days of .NET ~ Nov (in two weeks, smart ass - thanks, seriously. you're the best)
Nebraska Code Camp ~ April (...)
Twin Cities Code Camp ~ April / October
Iowa Code Camp ~ "Spring" in summer (June last year, July this year), and Novemberish
That Conference ~ August (HIIIIIIGHLY recommended - Kalahari water park, BACON BAR)
Norweigian Developer Conference ~ June (a maz ing)
@dahlbyk
dahlbyk / demo.gitconfig
Created November 24, 2014 06:22
Git Demo Aliases
# To start a demo between <start-ref> and <end-ref> (default = HEAD):
# git demo <start-ref> [<end-ref>]
# To step through commits toward <end-ref>:
# git next
[alias]
demo = !sh -c 'git update-ref DEMO_HEAD $(git rev-parse ${2-HEAD}) && git checkout -fq $1~0' -
next = !sh -c 'git checkout -fq $(git log ..DEMO_HEAD --pretty=format:"%H" | tail -n1)' -
let GetChainLength value =
let next x = match x % 2L with
| 0L -> x / 2L
| _ -> x * 3L + 1L
let rec chain n acc = match n with
| x when x <= 1L -> acc
| x -> chain (next x) (acc+1)
value, (chain value 1)
seq { 1L..999999L }
static void Main(string[] args)
{
var f = Fault(() => Console.WriteLine("Okay"),
() => Console.WriteLine("Fault"));
f();
Console.WriteLine();
var g = Fault(() => { throw new Exception("Oops"); },
() => Console.WriteLine("Fault"));
try
Index: branches/1.3.1/src/Core/IE.cs
===================================================================
--- branches/1.3.1/src/Core/IE.cs (revision 1091)
+++ branches/1.3.1/src/Core/IE.cs (working copy)
@@ -20,6 +20,7 @@
using System.Collections;
using System.Diagnostics;
using System.Drawing;
+using System.Net;
using System.Runtime.InteropServices;
alias.lg=log -w -C --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ar) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
alias.dd=diff -w -C --diff-filter=ACMRTUXB
alias.fp=format-patch -w -C --diff-filter=ACMRTUXB -o c:/Dev/JP/Patches
alias.new=log -w -C --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ar) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative origin/master..
alias.up=!git svn rebase && git push . remotes/git-svn:master && git push origin master
alias.dci=!git svn dcommit && git push . remotes/git-svn:master && git push origin master
filter disableSigning() {
$proj = $_
$xml = [xml](Get-Content $proj.FullName)
$propertyGroup = $xml.Project.PropertyGroup | ? {$_.SignAssembly}
if($propertyGroup.SignAssembly -eq 'true') {
echo "Disabling Signing: $proj"
$propertyGroup.SignAssembly = 'false'
$xml.save($proj.FullName)
Push-Location $proj.DirectoryName
PS>git init test
Initialized empty Git repository in C:/temp/test/.git/
>
PS>cd test
>
PS>git commit --allow-empty -m test
[master (root-commit) 33f14f7] test
>
@dahlbyk
dahlbyk / NestedSetModel.cs
Created March 31, 2011 04:19
Nested set model
public class NestedSetModelTest
{
public class Node
{
public Node(string value, params Node[] children)
{
Value = value;
Children = children;
}
@dahlbyk
dahlbyk / gist:932601
Created April 20, 2011 20:12
Write-ChildGitStatus
function Write-ChildGitStatus($dir = '.')
{
gci $dir |
where { $_.PSIsContainer } |
foreach {
pushd $_
$s = Get-GitStatus
if($s) {
Write-Host -NoNewline $_.Name
Write-GitStatus $s