Skip to content

Instantly share code, notes, and snippets.

View lfn3's full-sized avatar

Liam lfn3

View GitHub Profile
@lfn3
lfn3 / gist:035ff5f3c218b6763d7ac9da82b947ea
Last active June 7, 2018 03:22
JMock -> Mockito Regexes
allowing\((.+)\)\.(\w+\(.*\));\n\s*will\(returnValue\((.*)\)\);
given($1.$2).willReturn($3);
oneOf\((.+)\)\.(.+);
verify($1).$2;
ignoring\(.+\);
@lfn3
lfn3 / neat-little-things.clj
Created September 13, 2016 04:17
Little useful clojure snippets
(-> a f1 f2 (doto prn) f3 f4) ;Print intermediate value of a thread macro
@lfn3
lfn3 / core.clj
Created August 29, 2016 20:47
Validating values put into a channel with clojure spec
(ns channel-of.core
(:require [clojure.spec :as s]
[clojure.core.async :as a]
[clojure.core.async.impl.protocols :as ap]))
(defmacro chan-of [spec & chan-args]
`(let [ch# (a/chan ~@chan-args)]
(reify
ap/ReadPort
(take! [_ fn1-handler#]
@lfn3
lfn3 / printed-error.edn
Created August 4, 2016 21:42
Error in eulalie contains a little much.
{:response {:headers {:content-type "application/json",
:date "Thu, 04 Aug 2016 08:28:17 GMT",
:x-amzn-errortype "ValidationException",
:x-amzn-requestid "64b16f71-5a1d-11e6-8833-23d2071f4882",
:content-length "237",
:connection "Close"},
:status 400,
:body "{\"message\":\"1 validation error detected: Value '23d2071f4882/bad-arn'
at 'role' failed to satisfy constraint: Member must satisfy regular expression pattern:
arn:aws:iam::\\\\d{12}:role/?[a-zA-Z_0-9+=,.@\\\\-_/]+\"}",
@lfn3
lfn3 / proof.md
Created July 31, 2016 22:55
keybase-proof

Keybase proof

I hereby claim:

  • I am lfn3 on github.
  • I am lfn3 (https://keybase.io/lfn3) on keybase.
  • I have a public key whose fingerprint is E9BF A6E2 5A6D 5079 35D4 C101 9284 0C11 28FE 71AE

To claim this, I am signing this object:

@lfn3
lfn3 / docker-compose-logs.txt
Created January 5, 2016 19:03
Docker-compose up with dns as string fails in 1.5.2 on OSX logs
compose.config.config.find: Using configuration files: ./docker-compose.yml
docker.auth.auth.load_config: Trying /Users/lfalconer/.docker/config.json
docker.auth.auth.load_config: Found 'auths' section
docker.auth.auth.parse_auth: Found entry (registry=u'docker.liveopslabs.com', username=u'titan')
compose.cli.command.get_client: docker-compose version 1.5.2, build 7240ff3
docker-py version: 1.5.0
CPython version: 2.7.9
OpenSSL version: OpenSSL 1.0.1j 15 Oct 2014
compose.cli.command.get_client: Docker base_url: https://172.16.19.89:2376
compose.cli.command.get_client: Docker version: KernelVersion=3.16.0-30-generic, Os=linux, BuildTime=Fri Nov 20 13:16:54 UTC 2015, ApiVersion=1.21, Version=1.9.1, GitCommit=a34a1d5, Arch=amd64, GoVersion=go1.4.2