~pepe/neil

ab6fc14c6fc21c0833227c994b86a6ea8f8d3f24 — Josef Pospíšil 2 months ago a083d7b
Change string to .
M neil/guides.janet => neil/guides.janet +4 -4
@@ 39,7 39,7 @@
(defn next-id [brush]
  (def nid (inc (:soak brush :counter)))
  (:paint brush nid :counter)
  (string nid))
  (. nid))

(defn populate [data]
  (def now (os/time))


@@ 86,7 86,7 @@
  (def ic (length wis))
  (def ts (os/time))
  (if (pos? ic)
    (string ic "x "
    (. ic "x "
            (format-interval
              (reduce
                (fn [a w]


@@ 97,7 97,7 @@
  (def wis (task :work-intervals))
  (def ts (task :timestamp))
  (merge task
         {:label (string "#" (task :uuid) " " (task :name))
         {:label (. "#" (task :uuid) " " (task :name))
          :intervals-count wis
          :project-name project-name
          :date-time (format-date-time ts)


@@ 108,7 108,7 @@
  (def wis (task :work-intervals))
  (def ts (task :timestamp))
  (merge task
         {:label (string "#" (task :uuid) " " (task :name))
         {:label (. "#" (task :uuid) " " (task :name))
          :intervals-count wis
          :date-time (format-date-time ts)
          :human-ts (human ts)

M neil/hotline/init.janet => neil/hotline/init.janet +2 -2
@@ 32,7 32,7 @@
    (var kind "task")
    (var start (running :start))
    (var end (os/time))
    (var nnote (string (running :note) note))
    (var nnote (. (running :note) note))
    (def cmds (infer/command note))
    (when-let [tic (cmds :time)]
      (each [c d] tic


@@ 95,7 95,7 @@
    (def task (load brush id))
    (def wi-i (dec (length (task :work-intervals))))
    (-> task
        (update-in [:work-intervals wi-i :note] string note "; ")
        (update-in [:work-intervals wi-i :note] . note "; ")
        (merge-into (stamp)))
    (:dry brush))


M neil/watch/auth.janet => neil/watch/auth.janet +4 -4
@@ 28,7 28,7 @@
    {:update
     (fn [_ e]
       (def {:brush b} e)
       (:paint b exp :sessions (string sk))
       (:paint b exp :sessions (. sk))
       e)
     :watch (fn [&] shared/Dry)}
    "add-session"))


@@ 43,9 43,9 @@
        (cocoon/emerge (add sk expiration))
        (response 303 "" (merge {"Location" "/" "Content-Length" 0}
                                (cookie "session"
                                        (string sk "; Expires="
                                                (:http-format expiration)
                                                "; Secure; HttpOnly; Domain=" chidi ";")))))
                                        (. sk "; Expires="
                                           (:http-format expiration)
                                           "; Secure; HttpOnly; Domain=" chidi ";")))))
      see-auth)))

(defn change [brush key]

M neil/watch/middleware.janet => neil/watch/middleware.janet +1 -1
@@ 17,7 17,7 @@
    (def elapsed (* 1000 (- (os/clock) start)))
    (def head (peg/match headg resp))
    (when head
      (def fulluri (if (and qs (not (empty? qs))) (string uri "?" qs) uri))
      (def fulluri (if (and qs (not (empty? qs))) (. uri "?" qs) uri))
      (emerge
        (log (string/format "%s %s %s in %.3f ms" (head 0) method fulluri elapsed))))
    resp))

M neil/watch/projects.janet => neil/watch/projects.janet +1 -1
@@ 53,7 53,7 @@
                                    (stamp t)))]
      (do
        (save brush project :clients cid :projects)
        (string
        (.
          (page projects/new {:client-id cid})
          (page projects/list
                {:projects (sort-by-timestamp (values (get c :projects [])))

M neil/watch/tasks.janet => neil/watch/tasks.janet +1 -1
@@ 88,7 88,7 @@
                         {:project project :local-list ll}
                         {:projects (projects-with-client brush)})))
          ll
          (string
          (.
            (page tasks/list
                  (let [tasks (project-tasks-with-filter project (state= "active"))]
                    @{:list-name (. "Active tasks (" (length tasks) ")")

M neil/watch/utils.janet => neil/watch/utils.janet +2 -2
@@ 102,8 102,8 @@
  ~(hx-post-btn "add new task" "plus" "/tasks/add"))

(defmacro epoch-from [period body]
  ~(:epoch (,make-date-time (. (get ,body (string ,period "-date"))
                               " " (get ,body (string ,period "-time"))))))
  ~(:epoch (,make-date-time (. (get ,body (. ,period "-date"))
                               " " (get ,body (. ,period "-time"))))))

(defn sp->nbsp [label] (string/replace-all " " " " label))