Skip to content

Instantly share code, notes, and snippets.

@mattflo
mattflo / DataMunger.iced
Last active Aug 29, 2015
DataMunger.iced
View DataMunger.iced
# The data munging kata - http://codekata.com/kata/kata04-data-munging/
fs = require("fs")
readline = require("readline")
footballParseJob =
file: "./football.dat"
max_column: 6
min_column: 8
id: 1
@mattflo
mattflo / gist:8164428
Last active Jan 1, 2016
Google analytics code snippet for ghost blog.
View gist:8164428
//These lines were added in core/server/helpers/index.js
//on line 225, towards the end of the function: ghost.registerThemeHelper('ghost_head'..
var ga_code= "<script>(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ \
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), \
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) \
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');"
head.push(ga_code);
head.push("ga('create', '[your analytics site id]', '[your domain]');");
View gist:5283252
HOMEBREW_VERSION: 0.9.4
ORIGIN: (none)
HEAD: a14e1f21053711ac73692a6d27e8b952fa9febd4
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: quad-core 64-bit ivybridge
OS X: 10.8.3-x86_64
Xcode: 4.6.1
CLT: 4.6.0.0.1.1362189000
GCC-4.2: build 5666
View Elevator Kata
These are some features. They can be implemented in any order you prefer.
* an elevator responds to calls containing a source floor and direction
* an elevator delivers passengers to requested floors
* an elevator doesn't respond immediately. consider options to simulate time
* elevator calls are queued not necessarily FIFO
* you may validate passenger floor requests
* you may implement current floor monitor
* you may implement direction arrows
* you may implement doors (opening and closing)
View mineSweeper.spec.coffee
# node, jasmine, coffeescript, and rake installed/configured using
# steps outlined at this website:
# http://brizzled.clapper.org/id/117/index.html
# gem install guard
# gem install guard-shell
# guard init
# then put the following in GuardFile
# guard :shell do
# watch('.*') {`rake`}
View mancala.cs
using System;
using System.Collections.Generic;
using System.Linq;
using NUnit.Framework;
namespace describe_MacalaKata
{
public class Mancala : List<int>
{
public void Sow(int well)
@mattflo
mattflo / primeskata.coffee
Created Jan 24, 2012
exploring coffeescript
View primeskata.coffee
# node, jasmine, coffeescript, and rake installed/configured using
# steps outlined at this website:
# http://brizzled.clapper.org/id/117/index.html
# gem install guard
# gem install guard-shell
# guard init
# then put the following in GuardFile
# guard :shell do
# watch('.*') {`rake`}
View pimekata.js
primes = function(number){
divisor = 2;
while (divisor<number)
{
if (number % divisor == 0) return [divisor].concat(primes(number/divisor));
divisor = divisor + 1;
}
if (number == 1) return [];
View PokerKata.cs
using System.Collections.Generic;
using System.Linq;
using NUnit.Framework;
namespace PokerKata
{
[TestFixture]
public class describe_Hand
{
[Test]
View GameOfLifeKata.cs
using System.Collections.Generic;
using System.Linq;
using NSpec;
namespace GameOfLifeKata
{
class describe_Cell_Tick : nspec
{
void before_each()
{