Some common util functions I use in Clojure apps, that don't need to be their own projects
Clojure
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src/lstoll
test/lstoll/test
.env
.gitignore
.travis.yml
README.md
project.clj

README.md

utils Build Status

A set of common utility functions I keep re-using

env

This will retrieve a value from the current environment. If it's not there, it will fall back in to looking for the value in a .env file in the project root (in foreman key=value format). If the value doesn't exist there, it will fall back to either the default passed in, or nil

pmap2

The standard pmap, but takes a value as the first argument that determines the concurrency level to map at. Useful for IO bound mapping, like processing a series of URLs concurrently.

log

Prints the passed in data to stdout. Can accept a variable length of string or map arguments, these are appended together with a space in between them. Maps are re-formatted in to k=v strings e.g:

lstoll.utils> (log "message" "more" {:a "b" :c "d"} "final")
message more a=b c=d final

License

Copyright (C) 2012 Lincoln Stoll

Distributed under the Eclipse Public License, the same as Clojure.