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 devin [walters] | |
(println "yep, it works...")) |
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 twitjure | |
(:use clojure.core) | |
(:use clojure.contrib.http.connection) | |
(:use clojure.contrib.base64) | |
(:use clojure.contrib.duck-streams)) | |
(defn get-stream [] | |
(let [conn #^java.net.HttpURLConnection | |
(http-connection "http://stream.twitter.com/1/statuses/sample.json")] | |
(.setDoInput conn true) |
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 take-tweets [n] | |
(take n (map read-json | |
(line-seq (reader | |
(get-stream)))))) | |
(defn tweet-text [n] | |
(map #(get % "text") | |
(take-tweets n))) | |
(defn search-text [s coll] |
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
va.lang.NullPointerException | |
[Thrown class java.lang.RuntimeException] | |
Restarts: | |
0: [ABORT] Return to SLIME's top level. | |
1: [CAUSE] Throw cause of this exception | |
Backtrace: | |
0: clojure.lang.LazySeq.sval(LazySeq.java:47) | |
1: clojure.lang.LazySeq.seq(LazySeq.java:63) |
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 doc-ns | |
(:gen-class) | |
[:use clojure.contrib.duck-streams | |
compojure]) | |
(defn sort-ns | |
"Sorts the keys from the map returned by ns-publics for a given nspace into alphabetical order." | |
[nspace] | |
(sort (keys (ns-publics nspace)))) |
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 doc-ns.core | |
(:gen-class) | |
[:use clojure.contrib.duck-streams | |
compojure]) | |
(defn sort-ns | |
"Sorts the keys from the map returned by ns-publics for a given nspace into alphabetical order." | |
[nspace] | |
(sort (keys (ns-publics nspace)))) |
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 doc-ns "1.0.0-SNAPSHOT" | |
:description "Writes documentation for a namespace to a text file. | |
Usage: java -jar doc-ns.jar \"compojure\" \"~/\" \"myfile.txt\"" | |
:dependencies [[org.clojure/clojure | |
"1.1.0-alpha-SNAPSHOT"] | |
[org.clojure/clojure-contrib | |
"1.0-SNAPSHOT"] | |
[org.clojars.ato/compojure | |
"0.3.1"]] | |
:dev-dependencies [[org.clojure/swank-clojure |
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 cljex.view | |
[:use compojure]) | |
(defn api-entry | |
[doc-path] | |
(html-tree | |
[:h2 [:a {:href doc-path}]])) | |
;; (defn example-entry | |
;; [example-entry]) |
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 cljex.core | |
(:gen-class) | |
[:use compojure, | |
clojure.contrib.duck-streams, | |
clojure.contrib.shell-out, | |
clojure.contrib.str-utils, | |
cljex.view] | |
[:import java.io.File]) | |
(defn get-markdown-paths |
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
<p><html> | |
<head> | |
<link rel="stylesheet" href="pygmentize.css" type="text/css" media="screen" charset="utf-8"> | |
</head> | |
<body></p> | |
<h1>Foreword</h1> | |
<p>This is a very rough draft of the tutorial I'm going to put on | |
compojure.org. It's not complete, but it covers most of the basics. There's a possibility some of the terminology (such as handlers and routes) might change, but I'll let you know if it does. The technical content, however, should be accurate and up to date. Criticism is very welcome; I'd like to know if anything is unclear or could be better worded, or if I'm missing out anything. </p> | |
<h1>Compojure from the bottom up</h1> | |
<h2>Handlers</h2> |
OlderNewer