Skip to content

Instantly share code, notes, and snippets.

View MikeMKH's full-sized avatar
:shipit:
Learning about logic programming with Prolog

Mike Harris MikeMKH

:shipit:
Learning about logic programming with Prolog
  • Milwaukee, WI
  • 00:59 (UTC -05:00)
View GitHub Profile
@MikeMKH
MikeMKH / FizzBuzzSpecsSteps.cs
Last active August 29, 2015 14:03
FizzBuzz kata in C# using SpecFlow and FsCheck with NUnit
using System;
using System.Linq;
using FsCheck;
using FsCheck.Fluent;
using NUnit.Framework;
using TechTalk.SpecFlow;
namespace FizzBuzzerSpecs
{
[Binding]
@MikeMKH
MikeMKH / FizzBuzzProperties.cs
Created July 11, 2014 11:50
FizzBuzz kata in C# using FsCheck with MSTest
using System;
using System.Collections.Generic;
using System.Linq;
using FsCheck.Fluent;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace FizzBuzzProperties
{
[TestClass]
public class FizzBuzzProperties
@MikeMKH
MikeMKH / FizzBuzzerTests.cs
Created July 14, 2014 11:54
FizzBuzz kata in C# using FsCheck and NUnit
using System;
using System.Collections.Generic;
using System.Linq;
using FsCheck.Fluent;
using NUnit.Framework;
namespace FizzBuzz
{
[TestFixture]
public class FizzBuzzerTests
@MikeMKH
MikeMKH / ChangerTests.cs
Created July 21, 2014 12:08
Coin Changer kata in C# using NUnit
using System.Collections.Generic;
using System.Linq;
using NUnit.Framework;
namespace CoinChanger
{
[TestFixture]
public class ChangerTests
{
[TestCase(new int[]{}, 0, Result = new int[]{}, TestName="No coins for 0 cents")]
@MikeMKH
MikeMKH / index.html
Created July 26, 2014 15:26
FizzBuzz kata with AngularJS see also http://plnkr.co/edit/HMxS8H?p=info
<!DOCTYPE html>
<html ng-app="fizzbuzzApp">
<head>
<script data-require="angular.js@*" data-semver="1.3.0-beta.5" src="https://code.angularjs.org/1.3.0-beta.5/angular.js"></script>
<link rel="stylesheet" href="style.css" />
<script src="script.js"></script>
</head>
<body>
@MikeMKH
MikeMKH / app.js
Created August 24, 2014 15:19
Coin Changer kata with AngularJS using lodash
var app = angular.module('coinChangerApp', []);
// based on http://snippetrepo.com/snippets/lodash-in-angularjs
app.factory('_', ['$window',
function($window) {
return $window._;
}
]);
app.controller('CoinChangerCtrl', ['$scope', '_',
@MikeMKH
MikeMKH / a.js
Created September 7, 2014 15:03
A quick demo of how variables are scoped to functions in JavaScript and not files.
var a = "this is from a.js";
@MikeMKH
MikeMKH / 2_4_from_infinite.clj
Last active August 29, 2015 14:07
Getting the values of 2 and 4 from an infinite sequence of numbers.
(->> (range) (rest) (filter even?) (take 2))
@MikeMKH
MikeMKH / thrushy.clj
Created October 18, 2014 16:50
Thurshy example in Clojure
;;waterfall
(reduce +
(filter even?
(range 101)))
;;thrushy
(->> (range 101) (filter even?) (reduce +))
@MikeMKH
MikeMKH / FizzBuzzerTests.cs
Last active August 29, 2015 14:10
FizzBuzz kata in C# using FsCheck with MS Test
using FsCheck.Fluent;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace FizzBuzz
{
[TestClass]
public class FizzBuzzerTests
{
[TestMethod]
public void GivenAnEvenNumber_ResultMustBeSelfAsString()