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
user www www; | |
worker_processes 5; | |
error_log logs/error.log; | |
pid logs/nginx.pid; | |
worker_rlimit_nofile 8192; | |
events { | |
worker_connections 4096; | |
} |
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
(use '(clojure.contrib (str-utils :only (str-join)))) | |
(def print-trace println) ;; rebind locally as appropriate | |
(defmacro trace [form] | |
`(let [value# ~form] | |
(print-trace (format "%s => %s" '~form value#)) | |
value#)) | |
(defn trace-seq* [name value] |
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
(ns enlive-mw.core | |
(:use compojure) | |
(:require [net.cgrand.enlive-html :as e])) | |
(e/deftemplate simple-layout "enlive_mw/layout.html" | |
[{:keys [title ps widget]}] | |
#{[:title] [:h1]} (e/content title) | |
[:p] (e/clone-for [p ps] (e/content p)) | |
[:#widget] (e/content widget)) |
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
(-> "http://clojure-log.n01se.net/" java.net.URL. html-resource | |
(select {[:#main [:p (has [:b])]] [:#main [:p (right (has [:b]))]]}) | |
(let-select [[nick] [:b] | |
says [:p :> (but-node #{whitespace :b [:a first-of-type]})]] | |
[(text nick) (apply str (texts says))])) | |
(comment Sample output | |
(["bradbeveridge: " "is Java's ZipInputStream really slow, or am I using it wrong?\n clojurebot: pastebin?\n"] | |
["clojurebot: " "excusez-moi\n"] | |
["bradbeveridge: " "http://clojure.pastebin.com/zR9di5K0"] |