Skip to content

Instantly share code, notes, and snippets.

View mccraigmccraig's full-sized avatar

mccraigmccraig of the clan mccraig mccraigmccraig

View GitHub Profile
{;; this defines hierarchy-type and hierarchy-id attachments of
;; heritable-attrs and heritable-perms
:er-model.importer.import-sources/hierarchy-metadata
{"group"
;; attachments by hierarchy-type id
{:er-model.importer.import-objects/group-type-id
{;; hierarchytype 1 - root
"[[H]]1"
{:h_attrs
@mccraigmccraig
mccraigmccraig / profile.clj
Last active March 14, 2017 11:53
boot profile to retrieve encrypted passwords from gpg or env
;; ; specify S3 repositories with something like
;;
;; (set-env!
;; :wagons '[[s3-wagon-private "1.2.0"]]
;; :repositories #(concat % [["releases" {:url "s3p://your-s3-wagon-bucket/releases/"
;; :username [:env/aws_access_key :gpg]
;; :passphrase [:env/aws_secret_key :gpg]}]
;; ["snapshots" {:url "s3p://your-s3-wagon-bucket/snapshots/"
;; :username [:env/aws_access_key :gpg]
@mccraigmccraig
mccraigmccraig / profile.boot
Last active April 14, 2016 12:54
boot s3-wagon-private repository credentials from gpg or environment
;; ; specify S3 repositories with something like
;;
;; (set-env!
;; :wagons '[[s3-wagon-private "1.2.0"]]
;; :repositories #(concat % [["releases" {:url "s3p://your-s3-wagon-bucket/releases/"
;; :username [:env/aws_access_key :gpg]
;; :passphrase [:env/aws_secret_key :gpg]}]
;; ["snapshots" {:url "s3p://your-s3-wagon-bucket/snapshots/"
;; :username [:env/aws_access_key :gpg]
(ns delaymap
(:require [schema.core :as s])
(:import [clojure.lang MapEntry]))
(defn ^:private deref-seq [underlying]
(when-first [[k v] underlying]
(lazy-seq (cons (MapEntry. k @v) (deref-seq (rest underlying))))))
(defprotocol IValidatable
(schema [this])
(ns clustermap.application
(:require [parenjin.application :as app]
[parenjin.job :as job]
[clustermap.config :as conf]
[clustermap.connectors :as conn]
[clomponents.control :as clomp]))
(def app-spec {:enjins {
:ping {:model :clustermap.datasets.ping.dataset/dataset}
@mccraigmccraig
mccraigmccraig / yoyo-algo-monads.clj
Last active August 29, 2015 14:24
yoyo with cont-m from algo.monads
(require '[clojure.algo.monads :refer :all])
(defn with-something
[config]
(fn [cc]
(prn (str "setting up something: " (pr-str config)))
(let [r (cc :something)]
(prn "tearing down something")
r)))
@mccraigmccraig
mccraigmccraig / yoyo-with-cont-m-cats.clj
Last active August 29, 2015 14:24
yoyo with cont-m
(require '[cats.core :refer :all])
(require '[cats.monad.continuation :as cont])
(defn with-something
[config]
(cont/continuation
(fn [cc]
(prn (str "setting up something: " (pr-str config)))
(let [r (cc :something)]
(prn "tearing down something")
@mccraigmccraig
mccraigmccraig / lastcall-method
Created June 9, 2015 09:34
last-call wins for core.async API clients
;;;;;;;;;;;;;;;;;;;;; macro
(ns clustermap.lastcall-method
(:require [clojure.tools.macro :refer [name-with-attributes]]))
(defn ^:private lastcall-method*
"defines an API method with last-call-wins semantics : returns a
channel of a single-value, the response
only responses corresponding to the the last

Keybase proof

I hereby claim:

  • I am mccraigmccraig on github.
  • I am mccraigmccraig (https://keybase.io/mccraigmccraig) on keybase.
  • I have a public key whose fingerprint is 1200 ACF5 97F1 53C3 7246 5B5A 172A 5DB8 BFD8 9F3F

To claim this, I am signing this object:

#!/usr/bin/env sh
if ! which md5sum > /dev/null; then
echo Install md5sum
exit 1
fi
if ! which curl > /dev/null; then
echo Install curl
exit 1