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
;;framework.clj | |
;;... | |
(definterface ES | |
(putIfAbsent [k v]) | |
(rep [k old-val new-val]) | |
(get [k])) | |
(defn ^ES jes [] | |
(let [m (atom {})] | |
(reify ES |
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
var reverse = function(expr) { | |
var make_node = function(t, left, right) { | |
return {tag: t, | |
left: left, | |
right: right}; | |
}; | |
if (expr.tag == 'note') { | |
return expr; | |
} | |
return make_node(expr.tag, |
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
[ | |
Object | |
id: "invoice_no" | |
path: Array[4] | |
0: "statements" | |
1: "1" | |
2: "id" | |
3: "original" | |
length: 4 | |
__proto__: Array[0] |
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 rf-test.core | |
(:use (ringfinger core resource fields db auth auth-routes), ringfinger.db.inmem, | |
ringfinger.timesavers.hooks, | |
ring.util.serve)) | |
(make-user inmem :ringfinger_auth {:username "test"} "demo" "salt") | |
(defresource contacts | |
{:db inmem | |
:pk :name_slug |
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
Webpage error details | |
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; InfoPath.2) | |
Timestamp: Fri, 12 Aug 2011 12:45:11 UTC | |
Message: 'undefined' is null or not an object | |
Line: 643 | |
Char: 2 | |
Code: 0 |
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
(fn [f i] (map (fn [n] ((apply comp (take n (repeat f))) i)) (range))) |
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
(defproject +project+ "0.0.1-SNAPSHOT" | |
:description "TODO: Write project description" | |
:main +project+.core | |
:dependencies [[org.clojure/clojure "1.2.0"] | |
[org.clojure/clojure-contrib "1.2.0"] | |
[enlive "1.0.0-SNAPSHOT"] | |
[net.cgrand/moustache "1.0.0-SNAPSHOT"] | |
[ring/ring-core "0.3.0"] | |
[ring/ring-jetty-adapter "0.3.0"] | |
[ring/ring-devel "0.3.0"] |
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
(defprotocol Payroll | |
(paycheck [emp hrs])) | |
(defrecord HourlyEmployee [name rate] | |
Payroll | |
(paycheck [hrs] (* rate hrs))) | |
Fails with: | |
java.lang.IllegalArgumentException: Can't define method not in interfaces: paycheck (NO_SOURCE_FILE:13) |
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 cmc.server | |
(:use net.cgrand.enlive-html | |
net.cgrand.moustache | |
somnium.congomongo | |
ring.util.response | |
[ring.middleware params multipart-params file reload session stacktrace] | |
[clojure.contrib logging] | |
[cmc templates handlers]) | |
(:require [clojure.contrib.io :as io]) | |
(:import [java.io File])) |
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 cmc-application | |
(app | |
(wrap-session) | |
(wrap-if development? wrap-reload '[cmc.templates]) | |
(wrap-if development? wrap-stacktrace) | |
;; set application root | |
(wrap-if development? wrap-file "resources") | |
["app" &] | |
(app | |