Skip to content

Instantly share code, notes, and snippets.

import Color exposing (..)
import Graphics.Collage exposing (..)
import Graphics.Element exposing (..)
main : Element
main =
collage 300 300
[ blueLine
, xAxis
, yAxis
@cjwebb
cjwebb / cilic_v_berankis.txt
Created January 6, 2016 14:17
tennis scores, point by point, of a match at wimbledon 2015
Berankis 15:0 15:15 15:30 15:40, BP 6-3 4-6 7-6 4-6 7-5
Cilic 0:15 15:15 15:30 15:40 30:40 40:40 A:40 6-3 4-6 7-6 4-6 6-5
Berankis 15:0 30:0 40:0 40:15 6-3 4-6 7-6 4-6 5-5
Cilic 15:0 30:0 40:0 6-3 4-6 7-6 4-6 5-4
Berankis 15:0 30:0 40:0 6-3 4-6 7-6 4-6 4-4
Cilic 15:0 15:15 30:15 40:15 40:30 6-3 4-6 7-6 4-6 4-3
Berankis 0:15 15:15 30:15 40:15 6-3 4-6 7-6 4-6 3-3
Cilic 0:15 15:15 15:30 15:40 30:40 40:40 A:40 40:40 A:40 6-3 4-6 7-6 4-6 3-2
Berankis 15:0 15:15 30:15 40:15 6-3 4-6 7-6 4-6 2-2
Cilic 15:0 30:0 40:0 6-3 4-6 7-6 4-6 2-1
if [ -z "$1" ]
then
echo "Usage: ./kinesis-messages.sh <stream-name>"
exit 1
fi
streamname=$1; aws kinesis describe-stream --stream-name $streamname --output text | grep SHARDS | awk '{print $2}' | while read shard; do aws kinesis get-shard-iterator --stream-name $streamname --shard-id $shard --shard-iterator-type LATEST --output text | while read iterator; do while output=`aws kinesis get-records --shard-iterator $iterator --output text`; do iterator=`echo "$output" | head -n1 | awk '{print $2}'`; echo "$output" | awk 'NR > 1' | grep RECORDS | while read record; do echo $record | awk '{print $3}' | base64 -D | jq .; done; done; done; done
@cjwebb
cjwebb / Scala.Dockerfile
Created August 25, 2018 19:28
Scala SBT dockerfile - runs SBT to build, and then copies on the jar to the alpine java image
# This uses the Docker builder pattern.
# The first container runs SBT to stage our application.
# todo - use a Docker image that has already downloaded SBT
FROM hseeberger/scala-sbt AS builder
WORKDIR /app
COPY src src
COPY project project
COPY build.sbt build.sbt
RUN sbt stage