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
### Keybase proof | |
I hereby claim: | |
* I am dannypurcell on github. | |
* I am dannypurcell (https://keybase.io/dannypurcell) on keybase. | |
* I have a public key ASCjzth1ZMOS9r1X5BU6RpigTCZVY-RMxwHbzt6SQb2IuAo | |
To claim this, I am signing this object: |
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
#!/usr/bin/env bash | |
function usage { | |
cat <<USAGE | |
Usage: $0 <lwjgl_zip_url> | |
Arguments: | |
lwjgl_zip_url - url pointing to the lwjgl zip archive to download and install in the local m2/repository | |
USAGE | |
} |
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
import clojure.lang.IFn; | |
import clojure.lang.RT; | |
public class Clojure { | |
public static Object invokeCLJ(String ns, String fn, Object... args) throws NoSuchMethodException { | |
clojure.lang.Compiler.eval(RT.readString("(require '" + ns + " :reload-all)")); | |
clojure.lang.IFn f = (IFn) RT.var(ns, fn).deref(); | |
if (f == null) { | |
throw new NoSuchMethodException("Could not find " + fn + " in " + ns + " or could not load " + ns); |
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 ignore-trailing-slash | |
"Modifies the request uri before calling the handler. | |
Removes a single trailing slash from the end of the uri if present. | |
Useful for handling optional trailing slashes until Compojure's route matching syntax supports regex. | |
Adapted from http://stackoverflow.com/questions/8380468/compojure-regex-for-matching-a-trailing-slash" | |
[handler] | |
(fn [request] | |
(let [uri (:uri request)] | |
(handler (assoc request :uri (if (and (not (= "/" uri)) |