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
| Warning: The file properties have changed: | |
| File: /usr/bin/dpkg | |
| Current hash: 8e820f6ffa1ba84be7c5256a8bd344a49fec7182 | |
| Stored hash : 7c5ab2420dfddf22f3794a1f2aa4b61243e44a08 | |
| Current inode: 52015 Stored inode: 1969 | |
| Current file modification time: 1268271700 | |
| Stored file modification time : 1253435089 | |
| Warning: The file properties have changed: | |
| File: /usr/bin/dpkg-query | |
| Current hash: b5a6de09d70cd24592cb59dbdd2d58e9280a7cc0 |
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
| (defn connect [server] | |
| (let [socket (Socket. (:name server) (:port server)) | |
| in (BufferedReader. (InputStreamReader. (.getInputStream socket))) | |
| out (PrintWriter. (.getOutputStream socket)) | |
| conn (ref {:in in :out out})] | |
| (doto (Thread. #(conn-handler conn)) (.start)) | |
| conn)) | |
| (defn write [conn msg] | |
| (doto (:out @conn) |
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
| ;; load paths | |
| (setq dotfiles-dir (file-name-directory | |
| (or (buffer-file-name) load-file-name))) | |
| (add-to-list 'load-path dotfiles-dir) | |
| (if (fboundp 'normal-top-level-add-subdirs-to-load-path) | |
| (let* ((my-lisp-dir "~/.emacs.d/elpa-to-submit") | |
| (default-directory my-lisp-dir)) | |
| (setq load-path (cons my-lisp-dir load-path)) |
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 walton.core | |
| (:use clojure.contrib.duck-streams | |
| clojure.contrib.str-utils | |
| clojure.contrib.seq-utils | |
| clj-html.core | |
| net.licenser.sandbox | |
| walton.integration | |
| walton.web | |
| ring.util.response) | |
| (:gen-class)) |
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
| (defn truncate [t coll] | |
| (map (fn [ct] | |
| (if (>= (count ct) t) | |
| (apply str (take t ct) "...") | |
| ct)) coll)) | |
| (defn walton* | |
| [#^String s t m?] | |
| (let [result (walton-doc s)] |
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
| (defn truncate | |
| "A one off truncation function which takes a coll in the form of \"[:a, :b]\". Provided a [t]runcation length (in characters), it will truncate :a or :b and supply a new \"[\":a...\", \":b...\"]\"." | |
| [coll t] | |
| (let [c coll | |
| ct (first c) | |
| rt (second c)] | |
| [(if (>= (count ct) t) | |
| (apply str (take t ct) "...") | |
| ct) | |
| (if (>= (count rt) t) |
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
| (defn truncate [coll t] | |
| (let [c coll | |
| ct (first c) | |
| rt (second c)] | |
| [(if (>= (count ct) t) | |
| (apply str (take t ct) "...") | |
| ct) | |
| (if (>= (count rt) t) | |
| (apply str (take t rt) "...") | |
| rt)])) |
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 defn-test | |
| (:use clj-html.core | |
| [net.cgrand.moustache :only [app]] | |
| [ring.adapter.jetty :only [run-jetty]] | |
| [ring.util.response :only [response]])) | |
| (defhtml application [text body] | |
| [:html | |
| [:head | |
| [:title text]] |
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
| (def walton-web | |
| (app | |
| ["examples" text] | |
| {:get [(fn [req] (walton-doc* text))]} | |
| [#".*"] {:get ["all routes!"]})) |
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
| (defhtml application [text body] | |
| [:html | |
| [:head | |
| [:title text]] | |
| [:body | |
| [:h3 text] | |
| body]]) | |
| (defhtml code-list [body] | |
| [:ul body]) |