Skip to content

Instantly share code, notes, and snippets.

@FaustXVI
FaustXVI / tcrdd.sh
Created Dec 14, 2018
TCR merged with TDD
View tcrdd.sh
#!/usr/bin/env bash
BRANCH=origin/master
TEST_KEYWORD="Expect"
function runTest() {
./node_modules/.bin/elm-test
}
# look for a new test in a + line in the diff
function testJustAdded(){
View fizzbuzz_no_flow.js
"use strict";
import {should} from "chai";
should();
function fizzbuzz(n) {
const rules = [{multiple: 3, word: "fizz"}, {multiple: 5, word: "buzz"}];
return rules.filter(({multiple, _}) => n % multiple === 0)
.map(({_, word}) => word)
.reduce((a, b) => a + b, "")
View green.sh
#!/usr/bin/env bash
function test() {
runhaskell FiboSpecs.hs
}
function commit() {
git add .
git commit --squash=lastRed
}
@FaustXVI
FaustXVI / red.sh
Created Nov 13, 2018
Red script for tcr
View red.sh
#!/usr/bin/env bash
function test() {
runhaskell FiboSpecs.hs
}
function commit() {
git add .
git commit
git tag -f lastRed
}
View reset.cmd
:loop
timeout 120
git reset --hard -q
git clean -f -q .
goto :loop
View FizzBuzz.idr
import Data.So
fizz : Integer -> Bool
fizz n = (n `mod` 3) == 0
buzz : Integer -> Bool
buzz n = (n `mod` 5) == 0
data FizzBuzz : (n: Integer) -> Type where
Fizz : {auto fizz : So (fizz n)} -> FizzBuzz n
View reset.sh
#!/usr/bin/env sh
while :
do
sleep 120
git reset --hard -q
git clean -f -q .
done