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
(defmacro defmethods | |
"A convenience over writing lots of short `defmethod` statements that | |
use the same arguments: | |
(defmulti mm (fn [o x y] o)) | |
(defmethods mm [_ x y] | |
'+ (+ x y) | |
'- (- x y) | |
'* (* x y) | |
'/ (/ x y)) |
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 nested-map-zipper | |
(:require [clojure.zip :as zip] | |
[clojure.data :refer [diff]])) | |
(defmacro recur-if | |
([expr] | |
`(recur-if ~expr nil)) | |
([expr else] | |
`(let [temp# ~expr] | |
(if temp# (recur temp#) ~else)))) |
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 active-directory.guid.util | |
(:require [clojure.string :as str] | |
[clojure.data.codec.base64 :as b64])) | |
(defn decode | |
"Decodes a Base64 encoded string into a sequence of bytes" | |
[b64s] | |
(b64/decode (.getBytes b64s))) | |
(defn byte->hex |
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
#cloud-config | |
coreos: | |
etcd: | |
# generate a new token for each unique cluster from https://discovery.etcd.io/new | |
# WARNING: replace each time you 'vagrant destroy' | |
discovery: https://discovery.etcd.io/new | |
addr: $public_ipv4:4001 | |
peer-addr: $public_ipv4:7001 | |
fleet: |
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
# configure the Ruby Gems environment | |
export RUBYOPT=rubygems | |
export GEM_HOME="$HOME/.gem" | |
export GEM_PATH="$HOME/.gem" | |
export PATH="$HOME/.gem/bin:$PATH" | |
source ~/bin/ohmygems |
NewerOlder