Skip to content

Instantly share code, notes, and snippets.

View dahlbyk's full-sized avatar

Keith Dahlby dahlbyk

View GitHub Profile
@dahlbyk
dahlbyk / .gitattributes
Created July 13, 2011 16:05
C# .gitattributes
*.cs diff=csharp
@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
@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;
}
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
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
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;
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
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 }