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
(take 10 (filter #(clojure.string/ends-with? % "DefaultChannelPool") | |
(map str (.getAllClasses (com.google.common.reflect.ClassPath/from | |
(.getContextClassLoader (Thread/currentThread))))))) |
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
;; less-awful-ssl {:mvn/version "1.0.4"} | |
;; clj-http {:mvn/version "3.9.1"} | |
(let [trust-store (less.awful.ssl/trust-store (clojure.java.io/file "/var/run/secrets/kubernetes.io/serviceaccount/ca.crt")) | |
bearer-token (format "Bearer %s" (slurp "/var/run/secrets/kubernetes.io/serviceaccount/token")) | |
kube-api-host (System/getenv "") | |
kube-api-port (System/getenv "")] | |
(clj-http.client/get | |
(format "https://%s:%s/apis/<something-protected>" kube-api-host kube-api-port) | |
{:trust-store trust-store |
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
PARENT=$(basename $PWD) | |
GRANDPARENT=$(basename $(dirname $PWD)) | |
REPOPATH=$GRANDPARENT/$PARENT | |
if [ ! -d .git ]; then | |
echo "Cloning $REPOPATH into $PWD" | |
tfile=$(mktemp /tmp/envrc.XXXXXXXXX) | |
mv .envrc $tfile | |
git clone https://github.com/$REPOPATH.git ./ | |
mv $tfile .envrc |
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 example.api.google | |
(:require [cemerick.url :as url] | |
[cheshire.core :as json] | |
[clj-jwt.core :as jwt] | |
[clj-jwt.key :as key] | |
[clj-time.core :as time] | |
[clj-http.client :as http] | |
[clojure.string :as str]) | |
(:import java.io.StringReader)) |
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 reagent-test.core | |
(:require [reagent.core :as reagent :refer [atom]] | |
[datascript :as d] | |
[cljs-uuid-utils :as uuid])) | |
(enable-console-print!) | |
(defn bind | |
([conn q] | |
(bind conn q (atom nil))) |
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 foo.auth.google | |
(:require [clojure.string :as str] | |
[clojure.java.io :as io] | |
[clojure.data.json :as json] | |
[clojure.logging :refer :all] | |
[friend-oauth2.util :refer [format-config-uri]] | |
[friend-oauth2.workflow :as oauth2]) | |
(:import [java.security.cert CertificateFactory] | |
[org.apache.commons.codec.binary Base64])) |
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
(defn scrubbing-int-app-event-view-2 [app owner] | |
(reify | |
om/IInitState | |
(init-state [_] | |
{:capturing false | |
:start-x nil}) | |
om/IWillMount | |
(will-mount [_] | |
(let [mouse-chan (async/map (fn [e] {:x (.-clientX e) | |
:type (.-type e)}) |
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
(if (zero? (mod difference 5)) | |
(do (om/update-state! owner :my-val (partial + (/ difference 5))) | |
(om/set-state! owner :start-x x))) |
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
(defn scrubbing-int-state-view [app owner] | |
(let [start-capturing #(do (om/set-state! owner :capturing true) | |
(om/set-state! owner :start-x (.-clientX %))) | |
stop-capturing #(do (om/set-state! owner :capturing false) | |
(om/set-state! owner :start-x nil))] | |
(reify | |
om/IInitState | |
(init-state [_] | |
{:my-val 0 | |
:capturing false |
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
(defn listen [el & types] | |
(let [out (chan)] | |
(doall (map (fn [type] (events/listen el type #(put! out %))) types)) | |
out)) | |
(defn set-states! [owner desired] | |
(doall (map #(om/set-state! owner (key %) (val %)) desired))) |
NewerOlder