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
#!/bin/bash | |
# | |
# Bash script to automatically run a test suite every time a file is modified | |
# in the src or test directories. Plays a sound file to tell the user what's | |
# happening in an unobtrusive fashion. | |
PLAY="mplayer -really-quiet -nolirc" | |
while true; do | |
# Wait until a file has been changed |
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 flockr | |
(:use compojure)) | |
(defn index [] | |
(html | |
[:h1 "Flockr"] | |
[:h2 "Twitter Portal"])) | |
(defservlet home | |
(GET "/" |
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 flockr.template | |
(:use compojure)) | |
(defn page | |
[title body] | |
(html | |
[:html | |
[:head | |
[:title title]] | |
[:body |
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 flockr | |
(:use compojure ) | |
(:use flockr.template)) ; looks for flockr/template.clj |
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 twitter-status | |
[tweet] | |
[:p.tweet | |
[:div.tweet-text (tweet "text")] | |
[:div.tweet-user (get-in tweet ["user" "name"])]]) |
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 compojure.openid | |
"Compojure OpenID wrapper around jopenid library." | |
(:use compojure.control) | |
(:use compojure.encodings) | |
(:use compojure.http) | |
(:use compojure.http.session) | |
(:import com.javaeedev.openid.OpenIdManager) | |
(:import javax.servlet.http.HttpServletRequest)) | |
(defn- make-manager |
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- lex-1 | |
"Lex one symbol from a string, and return the symbol and trailing source." | |
[src clauses] | |
(some | |
(fn [[re action]] | |
(let [matcher (re-matcher re src)] | |
(if (.lookingAt matcher) | |
[(if (fn? action) (action matcher) action) | |
(.substring src (.end matcher))]))) | |
(partition 2 clauses))) |
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 example | |
{:deps ("weavejester/hello-world/1.0" | |
"weavejester/compojure/0.3.1")} | |
(:use weavejester.hello-world)) | |
(hello-world) |
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 #^{:deps "weavejester/compojure/0.3.1"} | |
example | |
(:use compojure)) |
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
(defmacro with-ns [ns & body] | |
`(binding [*ns* (the-ns ~ns)] | |
~@(map (fn [form] `(eval '~form)) body))) | |
(with-ns 'clojure.core | |
(def in-ns* in-ns) | |
(defn in-ns [name] | |
(doseq [dep (-> name meta :deps)] | |
(capra.package/install dep)) | |
(in-ns* name))) |
OlderNewer