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 collect-ways-by-node [ways] | |
(reduce (fn [m m2] (merge-with #(concat %1 %2) m1 m2)) | |
(for [way ways] | |
(for [id (:nodes way)] | |
(hash-map (:id way) [id]))))) | |
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 com.freiheit.clojure.appengine.appengine-local | |
(:use | |
[compojure.http routes servlet helpers] | |
clojure.contrib.test-is | |
compojure.server.jetty | |
[clojure.contrib def str-utils duck-streams]) | |
(:require | |
[clojure.contrib.logging :as log]) | |
(:import | |
[com.google.appengine.api.labs.taskqueue.dev LocalTaskQueue] |
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
;;; all code in this function lifted from the clojure-mode function | |
;;; from clojure-mode.el | |
(defun clojure-font-lock-setup () | |
(interactive) | |
(set (make-local-variable 'lisp-indent-function) | |
'clojure-indent-function) | |
(set (make-local-variable 'lisp-doc-string-elt-property) | |
'clojure-doc-string-elt) | |
(set (make-local-variable 'font-lock-multiline) t) |
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
; minihttpd, tiny barebones clojure web server | |
; http://alan.xen.prgmr.com/ | |
(ns alandipert.minihttpd | |
(:use [clojure.contrib.duck-streams :only (reader writer read-lines spit to-byte-array)] | |
[clojure.contrib.str-utils :only (re-split str-join re-gsub)]) | |
(:import (java.net ServerSocket URLDecoder) | |
(java.io File))) | |
(def codes {200 "HTTP/1.0 200 OK" |