Skip to content

Instantly share code, notes, and snippets.

(add-hook 'clojure-mode '(lambda () (paredit-mode t)))
(define-key lisp-mode-shared-map (kbd "RET") 'reindent-then-newline-and-indent)
(require 'slime)
(require 'swank-clojure)
(eval-after-load "slime"
'(progn
(require 'slime-banner)
(slime-banner-init)
;; fuzzy-completion
@devn
devn / init.el
Created December 29, 2009 23:22
;; load paths
(setq dotfiles-dir (file-name-directory
(or (buffer-file-name) load-file-name)))
(add-to-list 'load-path dotfiles-dir)
(add-to-list 'load-path (concat dotfiles-dir "/elpa-to-submit"))
(add-to-list 'load-path (concat dotfiles-dir "/elpa-to-submit/color-theme"))
(add-to-list 'load-path (concat dotfiles-dir "/elpa-to-submit/php-mode-1.5.0"))
(add-to-list 'load-path (concat dotfiles-dir "/elpa-to-submit/remember"))
(add-to-list 'load-path (concat dotfiles-dir "/elpa-to-submit/w3m"))
(add-to-list 'load-path (concat dotfiles-dir "/elpa-to-submit/magit"))
user> (System/getProperty "java.class.path")
"/Users/defn/git/cljex/test/:/Users/defn/git/cljex/src/:/Users/defn/git/cljex/classes/:/Users/defn/git/cljex/lib/clojure-1.1.0-alpha-20091215.130658-1.jar:/Users/defn/git/cljex/lib/clojure-1.1.0-alpha-SNAPSHOT.jar:/Users/defn/git/cljex/lib/clojure-contrib-1.0-20091212.214557-33.jar:/Users/defn/git/cljex/lib/clojure-couchdb-0.1.0-20091121.091400-3.jar:/Users/defn/git/cljex/lib/clojure-http-client-1.0.0-20091119.123056-1.jar:/Users/defn/git/cljex/lib/clojure-lang-1.1.0-alpha-20091215.130544-1.jar:/Users/defn/git/cljex/lib/clojure-lang-1.1.0-alpha-SNAPSHOT.jar:/Users/defn/git/cljex/lib/clojureql-1.0.0.jar:/Users/defn/git/cljex/lib/commons-codec-1.3.jar:/Users/defn/git/cljex/lib/commons-fileupload-1.2.1.jar:/Users/defn/git/cljex/lib/commons-io-1.4.jar:/Users/defn/git/cljex/lib/compojure-0.3.1.jar:/Users/defn/git/cljex/lib/derby-10.5.3.0_1.jar:/Users/defn/git/cljex/lib/jetty-6.1.21.jar:/Users/defn/git/cljex/lib/jetty-util-6.1.21.jar:/Users/defn/git/cljex/lib/mysql-conne
(defn docs-index []
"Creates links to all of the docs located in public/docs/*"
(html (map #(link-to %)
(map #(str %) (file-seq
(java.io.File. "/Users/defn/git/cljex/src/public/docs"))))))
(defn build-filename [input]
(str "_" (second (re-find #"\/(.*)\Z" (str input)))))
(defn sort-ns
"Sorts the vals from the map returned by ns-publics for a given nspace into alphabetical order."
[nspace]
(vals (ns-publics nspace)))
(defn print-core-docs-to-files
[path-to-files]
Debugger entered--Lisp error: (wrong-type-argument listp :after)
eieio-defmethod(initialize-instance (:after ((this rudel-socket-owner) &rest slots) "Attach THIS to as process object of our socket." (with-slots (socket) this (rudel-set-process-object socket this))))
(defmethod initialize-instance :after ((this rudel-socket-owner) &rest slots) "Attach THIS to as process object of our socket." (with-slots (socket) this (rudel-set-process-object socket this)))
eval-buffer(#<buffer *load*<5>> nil "/home/defn/src/rudel/rudel-util.el" nil t) ; Reading at buffer position 2998
load-with-code-conversion("/home/defn/src/rudel/rudel-util.el" "/home/defn/src/rudel/rudel-util.el" nil t)
require(rudel-util)
eval-buffer(#<buffer *load*<4>> nil "/home/defn/src/rudel/rudel.el" nil t) ; Reading at buffer position 1290
load-with-code-conversion("/home/defn/src/rudel/rudel.el" "/home/defn/src/rudel/rudel.el" nil t)
require(rudel)
eval-buffer(#<buffer *load*<3>> nil "/home/defn/src/rudel/rudel-mode.el" nil
.hll { background-color: #ffffcc }
.c { color: #0099FF; font-style: italic } /* Comment */
.err { color: #AA0000; background-color: #FFAAAA } /* Error */
.k { color: #006699; font-weight: bold } /* Keyword */
.o { color: #555555 } /* Operator */
.cm { color: #0099FF; font-style: italic } /* Comment.Multiline */
.cp { color: #009999 } /* Comment.Preproc */
.c1 { color: #0099FF; font-style: italic } /* Comment.Single */
.cs { color: #0099FF; font-weight: bold; font-style: italic } /* Comment.Special */
.gd { background-color: #FFCCCC; border: 1px solid #CC0000 } /* Generic.Deleted */
<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>
(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
(ns cljex.view
[:use compojure])
(defn api-entry
[doc-path]
(html-tree
[:h2 [:a {:href doc-path}]]))
;; (defn example-entry
;; [example-entry])