Skip to content

Commit

Permalink
use second time; bump 0.1.1-a4
Browse files Browse the repository at this point in the history
  • Loading branch information
tiye committed Dec 14, 2018
1 parent d8f5ae1 commit 509d8ae
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 6 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@ Cumulo Util (WIP)
[![Clojars Project](https://img.shields.io/clojars/v/cumulo/util.svg)](https://clojars.org/cumulo/util)

```edn
[cumulo/util "0.1.1-a3"]
[cumulo/util "0.1.1-a4"]
```

```clojure
(cumulo-util.core/find-first "x" ["x" "y"])
(cumulo-util.core/get-env! x) ; reading process.env[x]
(cumulo-util.core/id!)
(cumulo-util.core/unix-time!)
(cumulo-util.core/repeat! 1 #(println "doing")!) ; in seconds
(cumulo-util.core/delay! 1 #(println "done")!) ; in seconds

(cumulo-util.file/write-mildly! "a.text" "content")
(cumulo-util.file/get-backup-path!)
Expand Down
18 changes: 16 additions & 2 deletions calcit.edn

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion meyvn.edn
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

{:pom {:group-id "cumulo",
:artifact-id "util",
:version "0.1.1-a3",
:version "0.1.1-a4",
:name "Util functions for Cumulo projects"}
:packaging {:jar {:enabled true
:remote-repository {:id "clojars"
Expand Down
4 changes: 2 additions & 2 deletions src/cumulo_util/core.cljs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@

(ns cumulo-util.core (:require ["shortid" :as shortid]))

(defn delay! [duration task] (js/setTimeout task duration))
(defn delay! [duration task] (js/setTimeout task (* 1000 duration)))

(defn find-first [f xs] (reduce (fn [_ x] (when (f x) (reduced x))) nil xs))

(defn get-env! [property] (aget (.-env js/process) property))

(defn id! [] (.generate shortid))

(defn repeat! [duration task] (js/setInterval task duration))
(defn repeat! [duration task] (js/setInterval task (* 1000 duration)))

(defn unix-time! [] (.valueOf (js/Date.)))

0 comments on commit 509d8ae

Please sign in to comment.