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
{% export layout="simple" %} | |
{% export content do %} | |
<div class="content"> | |
<div class="page-header"> | |
<h1>Login</h1> | |
</div> | |
<div class="row"> | |
<div class="span16"> | |
{% form@tag id="login_form" do %} |
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 dummy | |
(:require [clojure.string :as str])) | |
(.log js/console (pr-str name)) | |
(defn unmunge [s] | |
(-> s | |
(str/replace #"_DOT_" ".") | |
(str/replace #"_" "-") | |
)) |
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 split-into-map [items key-fn] | |
(when-not (key-fn (first items)) | |
(throw (ex-info "first item is not a key" {:items items}))) | |
(loop [result {} | |
current-parts [] | |
items items] | |
(let [item (first items)] | |
(cond | |
(and (nil? item) (empty? items)) |
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
clojure.lang.ExceptionInfo: failed compiling file:src/cljs-admin/cms/admin/app.cljs | |
core.clj:4327 clojure.core/ex-info | |
compiler.clj:848 cljs.compiler/compile-file | |
compiler.clj:908 cljs.compiler/compile-root | |
closure.clj:374 cljs.closure/compile-dir | |
closure.clj:406 cljs.closure/eval1542[fn] | |
closure.clj:276 cljs.closure/eval1467[fn] | |
closure.clj:420 cljs.closure/eval1529[fn] | |
closure.clj:276 cljs.closure/eval1467[fn] | |
compiler.clj:43 cljsbuild.compiler.SourcePaths/fn |
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
ERROR in (cms-created-object) (core.clj:4327) | |
Uncaught exception, not in assertion. | |
expected: nil | |
ex-data[:sql]: "INSERT INTO cms_objects (owner,name,type,created_at) VALUES (?,?,?,?)" | |
ex-data[:values]: (1 "foo bar obj" :device #inst "2013-05-11T09:09:30.948000000-00:00") | |
actual: clojure.lang.ExceptionInfo: insert failed | |
at clojure.core$ex_info.invoke (core.clj:4327) | |
... stacktrace |
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 filter-file [filename] | |
(with-open [rdr (io/reader filename)] | |
(reduce (fn [words line] | |
(->> (str/split line #"\s+") | |
(filter #(and (<= (count %) 9) | |
(>= (count %) 4))) | |
(set) | |
(set/union words))) | |
#{} | |
(line-seq rdr)))) |
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
{:optimizations :advanced | |
:output-dir "target/cljs" | |
:module-dir "public/assets/js" | |
:modules [{:id :sub1 :include ["myapp.sub1"]} | |
{:id :admin :include ["myapp.admin"]} | |
{:id :sub2 :include ["myapp.sub2" | |
"myapp.something-else"]} | |
{:id :sub3 :include ["myapp.sub3"]} | |
]} |
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
(use '[clojure.core.match :only (match)]) | |
(use clojure.pprint) | |
(def form | |
'(match [(do-something)] | |
[[:ok value]] value | |
[[:error :not-found]] (do-something-else))) | |
(pprint (macroexpand-1 form)) |
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 thheller.async-test | |
(:use clojure.test) | |
(:require [clojure.core.async :as async :refer (go >! <! >!! <!!)])) | |
(def c (async/chan)) | |
(defn do-some-work [work] | |
(throw (ex-info "no way" {:work work}))) | |
(go (loop [work-done 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
(defn cond-transform [x & pairs] | |
(reduce (fn [x [test-fn transform-fn]] | |
(if (test-fn x) | |
(transform-fn x) | |
x)) | |
x | |
pairs)) | |
;; example |
OlderNewer