🚴♂️
This file contains hidden or 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
;; reference | |
;; https://github.com/kamil-perczynski/s3-direct-browser-upload | |
{:deps {org.clojure/clojure {:mvn/version "1.10.1"} | |
hiccup/hiccup {:mvn/version "2.0.0-alpha2"} | |
io.pedestal/pedestal.jetty {:mvn/version "0.5.8"} | |
io.pedestal/pedestal.service {:mvn/version "0.5.8"} | |
commons-codec/commons-codec {:mvn/version "1.15"} | |
com.cognitect.aws/api {:mvn/version "0.8.474"} | |
com.cognitect.aws/endpoints {:mvn/version "1.1.11.842"} |
This file contains hidden or 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
;; hello eql | |
[:app/hello] | |
;; data->shape | |
{:app/hello "ok"} | |
{:app/hello "ok" | |
:app/users [{:user/id 1 | |
:user/username "2" | |
:user/addresses [{:address/description "a" | |
:address/number 1}]}]} |
This file contains hidden or 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
(let [conn (doto (ds/create-conn {:user/addresses {:db/valueType :db.type/ref | |
:db/cardinality :db.cardinality/many} | |
:user/id {:db/unique :db.unique/identity}}) | |
(ds/transact! [{:user/id 1 | |
:user/addresses [-1 -2]} | |
{:user/id 2 | |
:user/addresses [-2 -3]} | |
{:user/id 3 | |
:user/addresses [-4]} | |
{:db/id -1 |
This file contains hidden or 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 com.wsscode.pathom.diplomat.http.java-http | |
(:require [com.wsscode.pathom.diplomat.http :as http] | |
[clojure.spec.alpha :as s] | |
[clojure.core.async :as async] | |
[clojure.string :as string] | |
[clojure.data.json :as json]) | |
(:import (java.net.http HttpResponse$BodyHandlers HttpRequest HttpClient HttpResponse HttpHeaders HttpRequest$BodyPublishers) | |
(java.net URI) | |
(java.util.function Function BiPredicate) | |
(java.util Optional))) |
This file contains hidden or 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
(let [parser (p/parser {::p/plugins [(pc/connect-plugin {::pc/register [(pc/constantly-resolver ::f 42)]})]}) | |
env {::p/reader [p/map-reader | |
pc/reader2]} | |
query [::f] | |
m {::f 42}] | |
(doseq [[k v] {:map-select #(p/map-select m query) | |
:parser #(parser env query) | |
:select-keys #(select-keys env query)}] | |
(prn k) | |
(dotimes [i 5] |

This file contains hidden or 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 user.pr | |
(:require [cognitect.aws.client.api :as aws] | |
[clj-http.client :as http] | |
[clojure.java.io :as io]) | |
(:import (org.eclipse.jgit.api Git))) | |
(defn slack->request | |
[text] | |
{:method :post | |
:url "https://hooks.slack.com/services/XX/YY/ZZ" |
This file contains hidden or 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
(let [{:keys [namespace-usages]} (:analysis (kondo/run! {:lint ["src/main" | |
"src/old"] | |
:config {:output {:analysis true}}})) | |
url->splited-path #(into [] | |
(comp (map (memfn getFileName)) | |
(map str) | |
(take-while (complement string/blank?))) | |
(iterate (fn [x] (when x (.getParent x))) | |
(Paths/get (new URI (-> (str %) | |
(string/replace #"^jar\:" |
This file contains hidden or 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
(let [atributo->item {:a {:atributo :a | |
:selecionado? true} | |
:b {:atributo :b | |
:selecionado? false} | |
:c {:atributo :c}}] | |
{:reduce (reduce-kv (fn [acc k {:keys [selecionado?]}] | |
(if (false? selecionado?) | |
acc | |
(conj acc k))) | |
#{} |
This file contains hidden or 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 exemplo | |
(:require [io.pedestal.http :as http])) | |
(def routes ::invalid) | |
(def server-build-time | |
(-> {::http/type :jetty | |
::http/routes routes | |
::http/port 8080} | |
http/default-interceptors |