Pieces refactored from frereth.common.util
Because I haven't really decided what to do with them yet
Pieces refactored from frereth.common.util Because I haven't really decided what to do with them yet
(get-cpu-count)
(get-current-thread)
(get-stack-trace ex)
Returns stack trace frame descriptions in a vector
Returns stack trace frame descriptions in a vector
(jvm-version)
(millis->nanos ms)
(minute)
(nanos->millis ns)
(pre-log human-name)
This is really just a leftover from trying to make 'normal' logging frameworks work
This is really just a leftover from trying to make 'normal' logging frameworks work
(pretty & xs)
Return a pretty-printed representation of xs
Return a pretty-printed representation of xs
(random-secure-bytes n)
Returns an array of n bytes, generated in a cryptographically secure manner
Returns an array of n bytes, generated in a cryptographically secure manner
(seconds)
(seconds->nanos ss)
(show-stack-trace ex)
Convert stack trace to a readable string Slow and inefficient, but you have bigger issues than performance if you're calling this
Convert stack trace to a readable string Slow and inefficient, but you have bigger issues than performance if you're calling this
(slurp-bytes bs)
Slurp the bytes from a slurpable thing
Copy/pasted from stackoverflow. Credit: Matt W-D.
alt approach: Add dependency to org.apache.commons.io
Or there's probably something similar in guava
Slurp the bytes from a slurpable thing Copy/pasted from stackoverflow. Credit: Matt W-D. alt approach: Add dependency to org.apache.commons.io Or there's probably something similar in guava
(spit-bytes f bs)
Spit bytes to a spittable thing
Spit bytes to a spittable thing
(update-values m f & args)
Apply f (& args) to each value in a map
Credit: http://blog.jayfields.com/2011/08/clojure-apply-function-to-each-value-of.html
Apply f (& args) to each value in a map Credit: http://blog.jayfields.com/2011/08/clojure-apply-function-to-each-value-of.html
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close