Liking cljdoc? Tell your friends :D

sparrows.misc


dissoc-empty-valclj

(dissoc-empty-val m)

Remove all entries with nil or empty val

Remove all entries with nil or empty val
raw docstring

dissoc-nil-valcljdeprecated

(dissoc-nil-val m)

Remove all entries with nil val

Remove all entries with nil val
raw docstring

get-apk-meta-infoclj

(get-apk-meta-info apk & [select-keys])

Get meta info as a seq of map from an apk. Requires aapt command on Linux system. select-keys is vector which can be used to filter entries to be returned.

Get meta info as a seq of map from an apk. Requires aapt command on
Linux system. `select-keys` is vector which can be used to filter
entries to be returned.
raw docstring

get-time-as-stringclj

(get-time-as-string time-millis
                    &
                    {:keys [format timezone]
                     :or {format "yyyy/MM/dd HH:mm:ss" timezone "GMT+8"}})

Convert epoch time in millis to string by wrapping around SimpleDateFormat. timezone should be like GMT-8 or GMT+8. Note that if no timezone is specified, GMT+8 will be employed.

Convert epoch time in millis to string by wrapping around
SimpleDateFormat. `timezone` should be like `GMT-8` or `GMT+8`.
Note that if no `timezone` is specified, GMT+8 will be employed.
raw docstring

if-and-letcljmacro

(if-and-let bindings then-clause)
(if-and-let bindings then-clause else-clause)

Like if-let, but with multiple bindings allowed. If all of the expressions in the bindings evaluate truthy, the then-clause is executed with all of the bindings in effect. If any of the expressions evaluates falsey,evaluation of the remaining binding exprs is not done, and the else-clause is executed with none of the bindings in effect. If else-clause is omitted, evaluates to nil if any of the binding expressions evaluates falsey. As with normal let bindings, each binding is available in the subsequent bindings. (if-and-let [a (get my-map :thing) b (do-thing-with a)] ...) is legal, and will not throw a null pointer exception if my-map lacks a :thing key and (do-thing-with nil) would throw an NPE. If there's something you want to be part of the then-clause's condition,but whose value you don't care about, including a binding of it to _ is more compact than nesting yet another if inside the then-clause. Example: (if-and-let [x (:a {:a 42}) y (first [(/ x 3)])] [x y] :nothing)

Like if-let, but with multiple bindings allowed. If all of the
expressions in the bindings evaluate truthy, the then-clause is
executed with all of the bindings in effect. If any of the expressions
evaluates falsey,evaluation of the remaining binding exprs is not
done, and the else-clause is executed with none of the bindings in
effect. If else-clause is omitted, evaluates to nil if any of the
binding expressions evaluates falsey. As with normal let bindings,
each binding is available in the subsequent
bindings. (if-and-let [a (get my-map :thing) b (do-thing-with a)] ...)
is legal, and will not throw a null pointer exception if my-map lacks
a :thing key and (do-thing-with nil) would throw an NPE. If there's
something you want to be part of the then-clause's condition,but whose
value you don't care about, including a binding of it to _ is more
compact than nesting yet another if inside the then-clause.
Example:
  (if-and-let [x (:a {:a 42}) y (first [(/ x 3)])] [x y] :nothing)
raw docstring

if-and-let*clj

(if-and-let* bindings then-clause else-clause deshadower)

lowercase-trimclj

(lowercase-trim str)

Convert to lowercase and trim. Returns nil if any exception occurs.

Convert to lowercase and trim. Returns nil if any exception occurs.
raw docstring

maybe-vals->intclj

(maybe-vals->int m)

Convert all values in a map to number if possible.

Convert all values in a map to number if possible.
raw docstring

now-millisclj

(now-millis)

now-nanosclj

(now-nanos)

num=clj

(num= & args)

Returns true if every argument is approximately equal. Converts string to number automatically.

Returns true if every argument is approximately equal. Converts string to number automatically.
raw docstring

rand-intsclj

(rand-ints n)

Return a string with n random digits

Return a string with `n` random digits
raw docstring

str->numclj

(str->num n)

String to number. If input is already a number, returns itself. Returns nil if input is not a number.

String to number. If input is already a number, returns
itself. Returns nil if input is not a number.
raw docstring

super-of?clj

(super-of? p c)

Determines if p is a super class/interface of c.

Usage (super-of? Throwable (.getClass e#))

Determines if `p` is a super class/interface of `c`.

Usage
`(super-of? Throwable (.getClass e#))`
raw docstring

trimclj

(trim input)

Trims a string, returns nil if the string is blank.

Trims a string, returns nil if the string is blank. 
raw docstring

uuidclj

(uuid)

Return uuid without hyphens

Return uuid without hyphens
raw docstring

wrap-exceptionclj

(wrap-exception func & [call-back])

Wrap exception with an optional call-back function. The call-back function accepts the exception e and the inputs of func as args. Returns nil if no call-back is provide.

Wrap exception with an optional `call-back` function.
The call-back function accepts the exception `e` and
the inputs of `func` as args. Returns nil if no
call-back is provide.
raw docstring

wrap-nil-on-errorcljmacro

(wrap-nil-on-error & body)

Eval (list* func args) in a try catch block. If any error is caught, returns nil

Eval (list* func args) in a try catch block. If any error is caught,
returns nil
raw docstring

wrap-timeclj

(wrap-time f)
(wrap-time key f)

Returns a wrapped function of the original, logs execution time of this function if :enable-time-logging is enabled.

Returns a wrapped function of the original, logs execution time of
this function if :enable-time-logging is enabled. 
raw docstring

zip-strclj

(zip-str s)

convenience function to parse xml string as clojure datastructure, first seen at nakkaya.com later in clj.zip src

convenience function to parse xml string as clojure datastructure, first seen at nakkaya.com later in clj.zip src
raw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close