Skip to content

Instantly share code, notes, and snippets.

@bretkoppel
bretkoppel / ClojureEuler1
Last active December 21, 2015 05:38
Clojure solution to Project Euler problem 1.
(reduce + (filter #(or (= 0 (mod % 3)) (= 0 (mod % 5))) (range 3 1000)))
@bretkoppel
bretkoppel / ClojureEuler2
Last active December 21, 2015 05:39
Clojure solution to Project Euler problem 2.
(defn fib-even []
(loop [x 0, y 1, acc 0]
(let [term (+ x y)]
(if (< y 4000000)
(recur y term (if (even? term) (+ acc term) acc))
acc))))
@bretkoppel
bretkoppel / gist:6449868
Created September 5, 2013 13:07
dotPeek decompilation of SortedSet<T>.FindNode
internal virtual SortedSet<T>.Node FindNode(T item)
{
for (SortedSet<T>.Node node = this.root; node != null; {
int num;
node = num < 0 ? node.Left : node.Right;
}
)
{
num = this.comparer.Compare(item, node.Item);
if (num == 0)
@bretkoppel
bretkoppel / AsyncFormsDemo.cs
Created March 3, 2014 19:38
AsyncFormsDemo
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Net;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.IO;
using System.Text;
using NUnit.Framework;
using Octodiff.Core;
using Octodiff.Diagnostics;
namespace Tests
{
[TestFixture]
public class OctoDiffCalculatorTests

Keybase proof

I hereby claim:

  • I am bretkoppel on github.
  • I am bretkoppel (https://keybase.io/bretkoppel) on keybase.
  • I have a public key ASA8prhb-of0xQcy3hpnIr7z4CnjqAk738rYl1uWq_Z74Qo

To claim this, I am signing this object: