Skip to content

Instantly share code, notes, and snippets.

(defn maven-pod* [version]
(pod/make-pod (update-in (boot/get-env)
[:dependencies]
conj ['org.apache.maven/maven-embedder version :scope "test"])))
(def maven-pod (memoize maven-pod*))
(deftask mvn
"Run Maven commands from Boot"
[A args ARGS str "Maven commands and options"
(defn mvn
"Run Maven commands from Leiningen."
[_project & args]
(let [mvn (new MavenCli)]
(.doMain mvn (into-array String args) "." System/out System/err)))
boot repl --server --bind 0.0.0.0 --port 12345 wait
@goranjovic
goranjovic / big-1-1.clj
Last active November 11, 2016 09:40
Big Solutions - Chromeclojure is back - snippet 1
(apply str (interpose \space ["Clojure" "is" "awesome"]))
@goranjovic
goranjovic / cf-3-9.java
Created September 23, 2016 08:39
Clockwork Fig - Map and Reduce - Conceptual differences Between Clojure and Hadoop - snippet 9
public void reduce(Text key, Iterator<IntWritable> values,
OutputCollector<Text, IntWritable> output,
Reporter reporter) throws IOException {
int min = Integer.MAX_VALUE;
while (values.hasNext()) {
int current = values.next().get();
if(current < min){
current = min;
}
@goranjovic
goranjovic / cf-3-8.clj
Created September 23, 2016 08:38
Clockwork Fig - Map and Reduce - Conceptual differences Between Clojure and Hadoop - snippet 8
(reduce min [4 2 1 5 3])
@goranjovic
goranjovic / cf-3-7.clj
Created September 23, 2016 08:34
Clockwork Fig - Map and Reduce - Conceptual differences Between Clojure and Hadoop - snippet 7
(mapcat #(repeat % %) [1 2 3 4 5])
;=> (1 2 2 3 3 3 4 4 4 4 5 5 5 5 5)
@goranjovic
goranjovic / cf-3-6.clj
Created September 23, 2016 08:33
Clockwork Fig - Map and Reduce - Conceptual differences Between Clojure and Hadoop - snippet 6
(apply concat (map #(repeat % %) [1 2 3 4 5]))
@goranjovic
goranjovic / cf-3-5.java
Created September 23, 2016 08:28
Clockwork Fig - Map and Reduce - Conceptual differences Between Clojure and Hadoop - snippet 5
public void map(Text key, IntWritable value,
OutputCollector<Text, IntWritable> output,
Reporter reporter)
throws IOException {
for(int i = 0; i < value.get(); i++){
output.collect(key, value);
}
}
@goranjovic
goranjovic / cf-3-4.clj
Created September 23, 2016 08:28
Clockwork Fig - Map and Reduce - Conceptual differences Between Clojure and Hadoop - snippet 4
(filter #(> % 3) [1 2 3 4 5])
;=> (4 5)