Skip to content

Instantly share code, notes, and snippets.

View mneedham's full-sized avatar

Mark Needham mneedham

View GitHub Profile
@mneedham
mneedham / rover.hs
Created June 15, 2012 22:34 — forked from uday-rayala/rover.hs
Mars rover in haskell
data Position = Position Int Int Direction
deriving (Show, Eq, Read)
data Direction = N | E | W | S
deriving (Show, Eq, Enum, Bounded, Read)
data Command = L | R | M
deriving (Show, Eq, Enum, Bounded, Read)
data DeltaPosition = DeltaPosition Int Int deriving (Show)
data State = State {
@mneedham
mneedham / neo4j-wait.sh
Created January 19, 2017 15:02 — forked from benbc/neo4j-wait.sh
Example of using curl to wait for a Neo4j server to be up
#!/bin/bash
end="$((SECONDS+10))"
while true; do
[[ "200" = "$(curl --silent --write-out %{http_code} --output /dev/null http://localhost:7474)" ]] && break
[[ "${SECONDS}" -ge "${end}" ]] && exit 1
sleep 1
done