This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(resource | |
{:id ::index | |
:methods | |
{:post | |
{:consumes "application/octet-stream" | |
:consumer (fn [ctx _ body-stream] | |
(let [f (java.io.File/createTempFile "yada" ".tmp" (io/file "/tmp"))] | |
(infof "Saving to file: %s" f) | |
(save-to-file | |
ctx body-stream |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(deftask cider "CIDER profile" | |
[] | |
(require 'boot.repl) | |
(swap! @(resolve 'boot.repl/*default-dependencies*) | |
concat '[[org.clojure/tools.nrepl "0.2.12"] | |
[cider/cider-nrepl "0.14.0"] | |
#_[refactor-nrepl "2.2.0"]]) | |
(swap! @(resolve 'boot.repl/*default-middleware*) | |
concat '[cider.nrepl/cider-middleware | |
#_refactor-nrepl.middleware/wrap-refactor]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Verifying that +malcolmsparks is my blockchain ID. https://onename.com/malcolmsparks |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn join? [p] | |
(and (map? p) (= (count p) 1))) | |
(defn pull [query v] | |
(reduce (fn [acc prop] | |
(cond | |
(keyword? prop) (conj acc (find v prop)) | |
(join? prop) (conj acc (let [[k q] (first prop)] | |
[k (pull q (get v k))] | |
)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn partition-by-tag | |
"" | |
([tag] | |
(fn [rf] | |
(let [adding? (atom false) | |
a (java.util.LinkedList.)] | |
(fn | |
([] (rf)) | |
([result] | |
(rf result)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defrecord DatabaseConnection [] | |
Lifecycle | |
(start [component] | |
(println "Database starting!") | |
component) | |
(stop [component] | |
(println "Database stopping") | |
component)) | |
(defn new-database [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; Copyright © 2016, JUXT LTD. | |
(ns edge.main | |
(:require | |
[om.next :as om :refer-macros [defui]] | |
[om.dom :as dom] | |
[goog.dom :as gdom])) | |
(def app-state | |
(atom {:app/title "The titl123e" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun modular-reset () | |
(interactive) | |
(save-some-buffers) | |
(cider-switch-to-repl-buffer) | |
(goto-char (point-max)) | |
(insert "(reset-and-test)") | |
;;(insert "(reset)") | |
;;(insert "(use 'training.core :reload)") | |
(cider-repl-return)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns foo.core | |
(:require [compojure.core :refer :all] | |
[ring.mock.request :refer [request]])) | |
(defn foo [] | |
"I don't do a whole lot." | |
(context "/api" [] | |
(context "/users" [] | |
(context "/:user-id" [user-id] | |
(context "/contacts" [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns foo.core | |
(:require [compojure.core :refer :all] | |
[ring.mock.request :refer [request]])) | |
(defn foo [] | |
"I don't do a whole lot." | |
(context "/api" [] | |
(context "/users" [] | |
(context "/:user-id" [user-id] | |
(context "/contacts" [] |