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 gitter.TreeIterator | |
(:import [org.eclipse.jgit.lib Repository FileMode] | |
[org.eclipse.jgit.treewalk WorkingTreeIterator WorkingTreeIterator$Entry WorkingTreeOptions] | |
[java.io ByteArrayInputStream]) | |
(:gen-class :extends org.eclipse.jgit.treewalk.WorkingTreeIterator | |
:init init2 | |
:post-init postinit | |
:state state | |
:constructors {[org.eclipse.jgit.lib.Repository Object] [org.eclipse.jgit.treewalk.WorkingTreeOptions] | |
[org.eclipse.jgit.lib.Repository Object org.eclipse.jgit.treewalk.WorkingTreeIterator] [org.eclipse.jgit.treewalk.WorkingTreeIterator]})) |
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 ohm | |
(:require [clojure.string :as string] | |
[clojure.java.io :refer [as-file]]) | |
(:import [java.io File])) | |
(defrecord Leaf [nss declares fns]) | |
(defn parse-value [value] | |
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 async4 | |
(:require [clojure.core.async :as async] | |
[clojure.core.async.lab :as lab])) | |
(defn inmate [name c] | |
(async/go | |
(async/<! c) | |
(println name " released"))) | |
(def alice (partial inmate "Alice")) |
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 async3 | |
(:require [clojure.core.async :as async])) | |
(defn alice [c message] | |
(async/>!! c message)) | |
(defn person [name c] | |
(async/go | |
(let [message (async/<! c)] | |
(println name " received: " message) |
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 async2 | |
(:require [clojure.core.async :as async] | |
[clojure.core.async.lab :as lab])) | |
(defn make-fb-group [& members] | |
(apply lab/broadcast members)) | |
(defn alice [c] | |
(async/>!! c "Dave Davenson's House @ 10pm")) |
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 async1 | |
(:require [clojure.core.async :as async])) | |
(defn alice [c] | |
(async/>!! c "Carol Carolson's House @ 10pm")) | |
(defn bob [c] | |
(async/go (println "Bob received: " (async/<! c)))) | |
(let [phonenumber-555-555-9292 (async/chan)] |
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 gittree.TreeIterator | |
(:import [org.eclipse.jgit.lib Repository FileMode] | |
[org.eclipse.jgit.treewalk WorkingTreeIterator WorkingTreeIterator$Entry WorkingTreeOptions] | |
[java.io ByteArrayInputStream]) | |
(:gen-class :extends org.eclipse.jgit.treewalk.WorkingTreeIterator | |
:init init2 | |
:post-init postinit | |
:state state | |
:constructors {[org.eclipse.jgit.lib.Repository Object] [org.eclipse.jgit.treewalk.WorkingTreeOptions] | |
[org.eclipse.jgit.lib.Repository Object org.eclipse.jgit.treewalk.WorkingTreeIterator] [org.eclipse.jgit.treewalk.WorkingTreeIterator]})) |
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 test1 | |
(:require [instaparse.core :as insta] | |
[net.cgrand.enlive-html :as enlive] | |
[clojure.walk :as walk])) | |
(defn render [nodes] | |
(walk/postwalk #(if (and (map? %) (:tag %)) | |
(with-meta (hash-map (:tag %) (:content %)) (:attrs %)) | |
%) nodes)) |
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 closing {\) \( | |
\} \{ | |
\] \[}) | |
(def opening [\( \{ \[]) | |
(defn zero-or-more [x] (if (>= x 0) x 0)) | |
(defn indent-exception? [[a b]] (not (and (= a \') (= b \()))) | |
; warning: Very basic clojure language parsing. It does not handle strings. | |
(defn reverse-parse | |
([data] (reverse-parse data [])) |
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
;[org.jodd/jodd-lagarto "3.4.2"] | |
;(:import [jodd.csselly CSSelly CssSelector Combinator Selector$Type]) | |
(defn format-attr-selector [x] | |
(case (.getName x) | |
"id" (str "#" (.getValue x)) | |
"class" (str "." (.getValue x)) | |
"")) | |
(defn format-selector [x] |