Liking cljdoc? Tell your friends :D

middlesphere.util


ctrl-c-hookclj

(ctrl-c-hook func-to-call)

Set global hook to catch <ctrl-c> event, log it and execute given function,

then shutdown Clojure agents.

  • Params: func-to-call - function, with no args, which should be executed during ctrl-c event.

  • Returns: nil

# Set global hook to catch <ctrl-c> event, log it and execute given function,
then shutdown Clojure agents.

 * Params:
	  **`func-to-call`** - function, with no args, which should be executed during ctrl-c event.

 * Returns:
	  _nil_
sourceraw docstring

dev-mode?clj

(dev-mode?)

Checks if development mode is turned on.

Dev mode is turned on/off by symbol dev-mode defined in namespace user

  • Returns: true if development mode is turned on. false if development mode is turned off.
# Checks if development mode is turned on.
   Dev mode is turned on/off by symbol `dev-mode` defined in namespace `user`

* Returns:
	  _true_  if development mode is turned on.
	  _false_ if development mode is turned off.
sourceraw docstring

dev-onlycljmacro

(dev-only & body)

If 'development only' mode turned on, returns body wrapped in do. If 'development only' mode is off returns nil. By default dev-only mode is turned on, when running REPL (:repl alias) and turned off for other tasks.

If 'development only' mode turned on, returns `body` wrapped in `do`.
If 'development only' mode is off returns nil.
By default dev-only mode is turned on, when running REPL (:repl alias)
and turned off for other tasks.
sourceraw docstring

doc-templateclj

(doc-template desc args return)

Generate doc string template for given args argument list.

  • Params: desc - String with description what function do. args - vector of symbols (argument names). return - String with description what function return.
  • Returns: String as doc string template.
# Generate doc string template for given `args` argument list.
* Params:
  **`desc`**   - _String_ with description what function do.
  **`args`**   - _vector_ of symbols (argument names).
  **`return`** - _String_ with description what function return.
* Returns:
  _String_ as doc string template.
sourceraw docstring

global-exception-hookclj

(global-exception-hook)
# Sets global exception hook to catch any uncaught exceptions and log it.

* Params:
  no params.

* Returns:
  _nil_
sourceraw docstring

if-let*cljmacro

(if-let* bindings then)
(if-let* bindings then else)

Multiple binding version of if-let.

  • Params: bindings - normal let bindings. then - S-form which will be evaluated if all bindings not nil. else - S-form which will be evaluated if one of bindings is nil. If else is absent then return nil.

  • Returns: value - any value which then or else produces.

    Example: (if-let* [a 1 b 2 c 3 ] (+ a b c) :some-has-nil)

# Multiple binding version of if-let.

* Params:
  **`bindings`** - normal let bindings.
  **`then`**     - S-form which will be evaluated if all bindings not nil.
  **`else`**     - S-form which will be evaluated if one of bindings is nil. If `else` is absent then return _nil_.

* Returns:
  _value_ - any value which `then` or `else` produces.

  Example:
    (if-let* [a 1
               b 2
               c 3 ]
        (+ a b c)
        :some-has-nil)
sourceraw docstring

jce-unlimited?clj

(jce-unlimited?)

Checks if JVM has unlimited cryptography strength.

  • Params: no params.

  • Returns: true - JVM has unlimited cryptography strength. false - JVM has unsecured cryptography (NOT FOR PRODUCTION).

# Checks if JVM has unlimited cryptography strength.

* Params:
  no params.

* Returns:
  _true_ - JVM has unlimited cryptography strength.
  _false_ - JVM has unsecured cryptography (NOT FOR PRODUCTION).
sourceraw docstring

nif-letcljmacro

(nif-let bindings & body)

Nested if-let. If all bindings are non-nil or true, executes body in the context of those bindings.

If a binding is nil or false, evaluates its else-expr form and stops there. else-expr is otherwise not evaluated.

  • Params: bindings - is two S-exp: binding-form else-expr

  • Returns: value - any value which let block returns or else-expr where nil/false is occurred.

Taken from here: https://www.proofbyexample.com/nested-if-let-in-clojure.html

Example: (nif-let [a x :a-is-nil b y :b-is-nil c z :c-is-nil d w :d-is-nil] (+ a b c d))

# Nested if-let. If all bindings are non-nil or true, executes body in the context of those bindings.
If a binding is nil or false, evaluates its `else-expr` form and stops there.
`else-expr` is otherwise not evaluated.

 * Params:
	  **`bindings`** - is two S-exp: binding-form else-expr

 * Returns:
	  _value_ - any value which let block returns or `else-expr` where nil/false is occurred.

Taken from here: https://www.proofbyexample.com/nested-if-let-in-clojure.html

Example:
  (nif-let [a x :a-is-nil
            b y :b-is-nil
            c z :c-is-nil
            d w :d-is-nil]
          (+ a b c d))
sourceraw docstring

obfuscate-mapclj

(obfuscate-map obj)

obfuscate values in map with sensitive data on all levels. map must contain meta data with :secrets key and vector of keywords which should be obfuscated as value. Example: (with-meta {:abc 123 :pwd "secret" :eee {:ssn 12345}} {:secrets [:pwd :ssn]}) return map of the same structure with obfuscated sensitive data on all levels. Example: {:abc 123 :pwd "obfuscated" :eee {:ssn 0}}

obfuscate values in map with sensitive data on all levels.
map must contain meta data with :secrets key and vector of keywords which should be obfuscated as value.
Example: (with-meta {:abc 123 :pwd "secret" :eee {:ssn 12345}}
           {:secrets [:pwd :ssn]})
return map of the same structure with obfuscated sensitive data on all levels.
Example: {:abc 123 :pwd "*obfuscated*" :eee {:ssn 0}}
sourceraw docstring

project-build-timecljmacro

(project-build-time)

Get current date and time as string.

  • Params: no params.

  • Returns: String - current date and time in format dd MMMM YYYY, HH:mm:ss.

# Get current date and time as string.

* Params:
  no params.

* Returns:
  _String_ - current date and time in format dd MMMM YYYY, HH:mm:ss.
sourceraw docstring

project-versioncljmacro

(project-version project-name)

Get current project version from Leiningen project using System properites.

  • Params: project-name - String name of project without ns.

  • Example: (project-version "util")

  • Returns: String - current version of project.

# Get current project version from Leiningen project using System properites.

* Params:
  **`project-name`** - _String_ name of project without ns.

* Example: (project-version "util")

* Returns:
  _String_ - current version of project.
sourceraw docstring

safecljmacro

(safe bindings? & forms)

Execute any S-expressions inside try-catch block.

  • Params: any number of S-exp.

  • Returns: value - any value if success. nil - if got Exception

# Execute any S-expressions inside try-catch block.

* Params: any number of S-exp.

* Returns:
  _value_ - any value if success.
                      _nil_    - if got Exception
sourceraw docstring

safe-logcljmacro

(safe-log & forms)

Execute any S-expressions inside try-catch block.

  • Params: forms - any number of S-exp.

  • Returns: value - any value if success. nil - if got Exception and log it.

# Execute any S-expressions inside try-catch block.

* Params:
  **`forms`** - any number of S-exp.

* Returns:
  _value_ - any value if success.
   _nil_    - if got Exception and log it.
sourceraw docstring

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

× close