Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

obj
bin
deploy
*.csproj.user
*.suo
*.cache
~$*
(define contains
(lambda (list item)
(and (not (null? list))
(or (= item (car list))
(contains (cdr list) item)))))
(define hasdup
(lambda (list)
(and (not (null? list))
(or (contains (cdr list) (car list))
@markrendle
markrendle / Git Bash.vbs
Created November 25, 2010 17:31
Modified Git Bash to use Console2
Set AppObj = CreateObject("Shell.Application")
If WScript.Arguments.Length=1 Then
AppObj.ShellExecute "C:\Console2\Console.exe", " -t ""Git Bash"" -d """ & WScript.Arguments(0) & """"
Else
AppObj.ShellExecute "C:\Console2\Console.exe", " -t ""Git Bash"""
End If
using System;
namespace OverloadResolutionChallenge
{
class Program : One
{
static void Foo<T>(T? t = default(T?)) where T : struct
{
Console.WriteLine("struct");
}
@markrendle
markrendle / TaskEx.cs
Created June 14, 2011 13:09
DelayedStart extension for System.Threading.Tasks.Task
public static class TaskEx
{
private static readonly ConcurrentDictionary<Task, Timer> Timers = new ConcurrentDictionary<Task, Timer>();
public static Task DelayedStart(this Task task, TimeSpan delay)
{
var timer = new Timer(_ => Start(task), null, (long)delay.TotalMilliseconds, -1L);
Timers.AddOrUpdate(task, timer, (k, t) => t);
return task;
}
namespace ElegantCache
{
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Runtime.Caching;
class ElegantCache<TValue> : IDisposable
@markrendle
markrendle / coffee.cmd
Created October 7, 2011 12:16
CoffeeScript compiler on Windows
@echo off
"%PROGRAMFILES%/Node/node.exe" "%PROGRAMFILES%/CoffeeScript/bin/coffee" %*
@markrendle
markrendle / MaybeMonad.cs
Created October 18, 2011 11:25
Maybe Monad in C#
namespace MaybeMonad
{
using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Reflection;
static class Monads
{
/// <summary>
@markrendle
markrendle / Output with 0.12.1.txt
Created November 30, 2011 21:14
Comparison of Simple.Data Bulk Insert with SQL Server Provider 0.12.1 and 0.12.2
00:00:16.9799819
00:00:17.1971797
00:00:18.0744958
00:00:19.1514537
00:00:17.3798541
@markrendle
markrendle / EnumerableOfOneTest.cs
Created December 9, 2011 10:49
Single-element enumerable comparison
namespace EnumerableOfOneTest
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Collections;
using System.Diagnostics;
class Program
{