- Run
docker run --rm -ti -p 5672:5672 -p 15672:15672 rabbitmq:3.6.5-management
- Fire up a Clojure REPL w/ langohr available
(require '[langohr.core :as rmq])
(def rconn (rmq/connect))
(require '[langohr.channel :as lch])
(def rch (lch/open rconn))
(require '[langohr.queue :as lq])
(lq/declare rch "foo.bar" {:exclusive false :auto-delete false :durable true})
(require '[langohr.consumers :as lcons])
(lcons/subscribe rch "foo.bar" (fn [_ _ ^bytes m] (println (String. m "UTF-8"))) {:auto-ack true})
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
<!DOCTYPE html> | |
<meta charset="utf-8"> | |
<link rel="stylesheet" href="http://cmx.io/v/0.1/cmx.css"> | |
<script src="http://cmx.io/v/0.1/cmx.js" charset="utf-8"></script> | |
<style>.cmx-user-scene4 .cmx-text-border .cmx-path {stroke: orange}</style> | |
<body> | |
<div style="max-width:900px; -webkit-transform:rotate(0deg)"> | |
<scene id="scene1"> | |
<label t="translate(0,350)"> |
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
;; Usually when doing a shallow transform on a map in Clojure I reach for `reduce-kv`, but when I have more than one reduce-kv | |
;; I start thinking I should use transducers instead. | |
;; So if I start with something like this: | |
(ns my.ns | |
(:require [clojure.edn :as edn])) | |
(defn strip-key-namespaces [m] | |
(reduce-kv | |
(fn [a k v] |
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
Verifying that "wesmorgan.id" is my Blockstack ID. https://onename.com/wesmorgan |
NOTE: This is version 1 of the exercise. We used it for the first 2 rounds of dev hiring in which we had an anonymous coding exercise at all. There is now a version 2 developed in collaboration with staff developers who were subjected to this one as candidates. They had... opinions.
This assignment is designed to gauge how well you know or can pick up Clojure and some common libraries to build a simple web application.
You should spend no more than a week on it. In fact, it is due one week after it is assigned. You should also focus on depth rather than breadth. Do as much good work as you can on each step rather than trying to do a little work on more steps.
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
diff --git a/standalone.xml b/standalone.xml | |
index 9547877..f47202b 100644 | |
--- a/standalone.xml | |
+++ b/standalone.xml | |
@@ -77,7 +77,7 @@ | |
<profile> | |
<subsystem xmlns="urn:jboss:domain:logging:2.0"> | |
<console-handler name="CONSOLE"> | |
- <level name="INFO"/> | |
+ <level name="DEBUG"/> |
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 connect-to-broker | |
([config] (connect-to-broker config 5)) | |
([config max-tries] | |
(first (drop-while nil? (connect-to-broker config max-tries 1)))) | |
([config max-tries attempt] | |
(if (<= attempt max-tries) | |
(try | |
[(rmq/connect config)] | |
(catch Throwable t | |
(log/warn "RabbitMQ not available:" (.getMessage t) "attempt:" attempt) |
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
Plugin 'balias' is not installed. Run 'omf install' to download and install it. | |
wmorgan@Wes-MacBook-Pro:~/d/ballot-scout|master⚡*? | |
➤ omf install | |
Installing balias... ✔ | |
test: Missing argument at index 1 | |
Installing ... fish: Could not expand string '$argv[3]' | |
/Users/wmorgan/.oh-my-fish/plugins/omf/omf.git.fish (line 5): set -l path $argv[3] | |
^ | |
in function 'omf.git', | |
called on line 31 of file '/Users/wmorgan/.oh-my-fish/plugins/omf/omf.packages.install.fish', |
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
{ | |
"AWSTemplateFormatVersion": "2010-09-09", | |
"Description": "CoreOS on EC2: http://coreos.com/docs/running-coreos/cloud-providers/ec2/", | |
"Mappings" : { | |
"RegionMap" : { | |
"eu-central-1" : { | |
"AMI" : "ami-0e300d13" | |
}, |
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
#!/bin/bash | |
set -e | |
VERSION=$(grep '\[com.datomic/datomic-pro "' project.clj | awk -F\" '{print $2}') | |
curl -u $(<.datomic-credentials) -SL https://my.datomic.com/repo/com/datomic/datomic-pro/$VERSION/datomic-pro-$VERSION.zip -o /tmp/datomic.zip | |
unzip /tmp/datomic.zip -d /tmp/datomic | |
rm -f /tmp/datomic.zip |
NewerOlder