General purpose utility fns that I seem to end up needing in every single project I write... Note: this namespace is not part of the public API of lice-comb and may change without notice.
General purpose utility fns that I seem to end up needing in every single project I write... Note: this namespace is not part of the public API of lice-comb and may change without notice.
(base62-decode s)
Decodes the given Base62/UTF-8 string.
Decodes the given Base62/UTF-8 string.
(base62-encode s)
Encodes the given string to Base62/UTF-8.
Encodes the given string to Base62/UTF-8.
(escape-re s)
Escapes the given string for use in a regex.
Escapes the given string for use in a regex.
Returns just the name component of the given file-like thing (String, File, ZipEntry, URI, URL), excluding any parents.
Returns just the name component of the given file-like thing (String, File, ZipEntry, URI, URL), excluding any parents.
Returns the full path and name of the given file-like thing (String, File, ZipEntry, URI, URL).
Returns the full path and name of the given file-like thing (String, File, ZipEntry, URI, URL).
(filter-file-only-seq dir dir-pred file-pred)
As for clojure.core/file-seq, with support for filtering and only returns files (but not any directories that were traversed during the seq). dir-pred controls which directories will be recursed into. file-pred controls which files will be included in the result. Both must be a predicate of one argument of type java.io.File.
As for clojure.core/file-seq, with support for filtering and only returns files (but not any directories that were traversed during the seq). dir-pred controls which directories will be recursed into. file-pred controls which files will be included in the result. Both must be a predicate of one argument of type java.io.File.
(filter-file-seq dir dir-pred file-pred)
As for clojure.core/file-seq, but with support for filtering. dir-pred controls which directories will be included in the result and recursed into. file-pred controls which files will be included in the result. Both must be a predicate of one argument of type java.io.File.
Note also that dir is always returned, even if it does not meet dir-pred.
As for clojure.core/file-seq, but with support for filtering. dir-pred controls which directories will be included in the result and recursed into. file-pred controls which files will be included in the result. Both must be a predicate of one argument of type java.io.File. Note also that dir is always returned, even if it does not meet dir-pred.
(filter-file-seq* dir pred)
As for clojure.core/file-seq, but with support for filtering. pred must be a predicate that accepts one argument of type java.io.File. Files that don't meet pred will not be included in the result, and directories that don't meet pred will not be recursed into (so pred must be able to handle both distinct cases).
Note also that dir is always returned, even if it does not meet pred.
As for clojure.core/file-seq, but with support for filtering. pred must be a predicate that accepts one argument of type java.io.File. Files that don't meet pred will not be included in the result, and directories that don't meet pred will not be recursed into (so pred must be able to handle both distinct cases). Note also that dir is always returned, even if it does not meet pred.
(getenv var)
(getenv var default)
Obtain the given environment variable, returning default (or nil, if default is not provided) if it isn't set.
Obtain the given environment variable, returning default (or nil, if default is not provided) if it isn't set.
(html->text html)
Converts html
(a String) to plain text (also a String).
Converts `html` (a String) to plain text (also a String).
(is-digits? s)
Does the given string contains digits only?
Does the given string contains digits only?
(map-pad f & cs)
Like map, but when presented with multiple collections of different lengths, 'pads out' the missing elements with nil rather than terminating early.
Like map, but when presented with multiple collections of different lengths, 'pads out' the missing elements with nil rather than terminating early.
(mapfonk f m)
Returns a new map where f has been applied to all of the keys of m.
Returns a new map where f has been applied to all of the keys of m.
(mapfonv f m)
Returns a new map where f has been applied to all of the values of m.
Returns a new map where f has been applied to all of the values of m.
(nset coll)
nil preserving version of clojure.core/set
nil preserving version of clojure.core/set
(re-concat & res)
Concatenate all of the given regexes or strings into a single regex.
Concatenate all of the given regexes or strings into a single regex.
(readable-dir? d)
Is d (a String or File) a readable directory?
Is d (a String or File) a readable directory?
Is f (a String, File, InputStream, or Reader) a readable file?
Is f (a String, File, InputStream, or Reader) a readable file?
(simplify-uri uri)
Simplifies a URI (which can be a string, java.net.URL, or java.net.URI) if possible, returning a String. Returns nil if the input is nil or blank.
Simplifies a URI (which can be a string, java.net.URL, or java.net.URI) if possible, returning a String. Returns nil if the input is nil or blank.
(strim s)
nil safe version of clojure.string/trim
nil safe version of clojure.string/trim
(valid-http-uri? s)
Returns true if given string is a valid HTTP or HTTPS URI.
Returns true if given string is a valid HTTP or HTTPS URI.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close