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
(defn assert-only-expected-keys | |
"Make sure that there are no extra keys in the item" | |
[keyset item] | |
(mapv (fn [k] (is (keyset k) (str k " is not one of " keyset))) | |
(keys item)) | |
item) | |
(defn assert-all-expected-keys | |
"Make sure that every expected key exists in the item" | |
[keyset item] |
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
(defn OPTIONS | |
"Generate a OPTIONS route with the given response." | |
[response] | |
(fn [request] | |
(when (= (:request-method request) :options) | |
response))) | |
(defroutes routes | |
(GET "/" [] "<h1>Hello World</h1>") | |
(context (:registry contexts) [] registry) |
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
(def servlets | |
"Map of servlet classes to ring handlers, add here. Needs to be quoted so symbols resolve to themselves." | |
'{:my.servlet.class.Servlet hr/app}) | |
(defmacro make-servlet | |
"Call to generate a servlet class given the class name and a ring handler." | |
[servlet handler] | |
(let [servlet (name servlet) | |
prefix (str servlet "-")] | |
`(do (println "Compiling Servlet" ~servlet) |
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
INFO: Initiating Jersey application, version 'Jersey: 1.4 09/11/2010 10:30 PM' | |
Jul 27, 2012 6:00:42 PM com.sun.jersey.spi.inject.Errors processErrorMessages | |
SEVERE: The following errors and warnings have been detected with resource and/or provider classes: | |
WARNING: A sub-resource method, public javax.ws.rs.core.Response com.cloudera.hoop.Hoop.root(java.security.Principal,com.cloudera.hoop.GetOpParam,com.cloudera.hoop.FilterParam,com.cloudera.hoop.DoAsParam) throws java.io.IOException,com.cloudera.lib.service.HadoopException, with URI template, "/", is treated as a resource method | |
SEVERE: Method, public javax.ws.rs.core.Response com.cloudera.hoop.Hoop.get(java.security.Principal,com.cloudera.hoop.FsPathParam,com.cloudera.hoop.GetOpParam,com.cloudera.hoop.OffsetParam,com.cloudera.hoop.LenParam,com.cloudera.hoop.FilterParam,com.cloudera.hoop.DoAsParam) throws java.io.IOException,com.cloudera.lib.service.HadoopException, annotated with GET of resource, class com.cloudera.hoop.Hoop, is not recognized as valid |
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 pomoclojo.core | |
(:import [org.apache.commons.exec | |
PumpStreamHandler | |
DefaultExecutor | |
ExecuteWatchdog | |
CommandLine] | |
[java.io ByteArrayOutputStream]) | |
(:use [clj-time.core :only [in-secs in-minutes now interval plus minus within? minutes secs]])) | |
(defn execute |
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
(defproject swanker "0.1.0-SNAPSHOT" | |
:description "Swank REPL for various usages" | |
:url "http://example.com/FIXME" | |
:license {:name "Eclipse Public License" | |
:url "http://www.eclipse.org/legal/epl-v10.html"} | |
:dependencies [[org.clojure/clojure "1.4.0"] | |
[swank-clojure "1.4.2"] | |
[javax.servlet/servlet-api "2.5" :scope "provided"]] | |
:aot [swanker.core]) |
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
java.lang.AbstractMethodError: null | |
at clojure.core.protocols/fn (protocols.clj:73) | |
clojure.core.protocols$fn__5828$G__5823__5841.invoke (protocols.clj:13) | |
clojure.core$reduce.invoke (core.clj:6030) |
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 swanker.core | |
(:require [swank.swank :as swank])) | |
(gen-class | |
:name swanker.core.ServletFilter | |
:prefix servlet- | |
:implements [javax.servlet.ServletContextListener]) | |
(comment |
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
Books I've read that I recommend, pretty much in the order that I read them, I'm not listing books that I | |
considered to be too specific, without any generic and fundamental knowledge, or that could easily be replaced by other, similar books: | |
Code Complete 2 | |
Programming Pearls (didn't finish it yet) | |
The Pragmatic Programmer | |
Mythical Man Month | |
Effective C++ Scott Meyers | |
Design Patterns (Gang of Four) (good reference, but pretty dry) | |
Pattern Hatching (explains how they came up with them) | |
Refactoring (Martin Fowler, (google for the pdf, read the first few |
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 pomoclojo.core | |
(:import [org.apache.commons.exec | |
PumpStreamHandler | |
DefaultExecutor | |
ExecuteWatchdog | |
CommandLine] | |
[java.io ByteArrayOutputStream]) | |
(:use [clj-time.core :only [in-secs in-minutes now interval plus minus within? minutes secs]])) | |
(defn execute |