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 clj-demgen-api "0.1.0-SNAPSHOT" | |
:description "FIXME: write description" | |
:dependencies [[org.clojure/clojure "1.6.0"] | |
[com.taoensso/timbre "3.3.1"] | |
[com.novemberain/validateur "2.3.1"] | |
[com.sun.mail/javax.mail "1.5.2"] | |
[metosin/compojure-api "0.16.5"] | |
[metosin/ring-http-response "0.5.2"] | |
[metosin/ring-swagger-ui "2.0.17"]] |
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
(let [my-cs (clj-http.cookies/cookie-store)] | |
(http/post (str (url) "/login") {:params {:username "login" | |
:password "pass"} | |
:form-params {:username "login" | |
:password "pass"} | |
:cookie-store my-cs}) | |
(let [csrftoken (url-decode (get-in (clj-http.cookies/get-cookies my-cs) ["csrftoken" :value]))] | |
(http/post (str (url) "/action/infocenter/1/upload-offer") |
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
:profiles {:dev {:source-paths ["dev"] | |
:env {:http-port 3000 | |
:context-path "" | |
:demgen-home "home" | |
:db-path "db" | |
:db-user "sa" | |
:db-pass ""}} |
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 ^:dynamic *db* nil) | |
(defn run-migrations [db files direction] | |
(doseq [file files] | |
(binding [*ns* (find-ns 'clj-sql-up.migrate) | |
*db* db] | |
(files/load-migration-file file) | |
(println "Up found at: " (resolve direction))) | |
(println "Up found at: " (resolve direction)) |
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
Talk Title: Frameworkless Web Programming in Clojure | |
Content of the Talk: | |
1. Why Web Frameworks? | |
- Everything from one source (parts fit together) | |
- Good tooling support (see Django) | |
- Easy to set up | |
- Easy to use |
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
> $ curl -I 'http://localhost:40400/bootstrap/css/bootstrap.min.css' -H 'Accept: text/css,*/*;q=0.1' -H 'Cache-Control: max-age=0' -H 'X-DevTools-Emulate-Network-Conditions-Client-Id: A35742C9-1C67-620E-7D73-629A1F5B18B9' -H 'Referer: http://localhost:40400/login' -H 'If-Modified-Since: Tue, 07 Oct 2014 14:36:50 GMT' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.124 Safari/537.36' --compressed | |
HTTP/1.1 304 Not Modified | |
Set-Cookie: ring-session=f6e2b275-1ccb-41fa-b6b8-1a59994e7426;Path=/ | |
Set-Cookie: csrftoken=1pYlnSWA7Dmr1S7vBkpdSjNrd0x%2FH91cbpNBaPVfpjFvGEWHUMebCGSQGbaNSnHkqpeGD3VCz6YVsVc%2F;Path=/ | |
Content-Type: text/css | |
Last-Modified: Tue, 07 Oct 2014 14:36:50 GMT | |
Content-Length: 101595 | |
Content-Length: 0 | |
Server: http-kit |
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 clj-demgen.plugin-test | |
(:require [clj-demgen.plugin :refer :all] | |
[clojure.test :refer :all] | |
[immutant.dev])) | |
(defn can-resolve? [symbol] | |
(not (nil? (resolve symbol)))) | |
(defn can-not-resolve? [symbol] | |
(not (can-resolve? symbol))) |
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
1. Unhandled java.lang.IllegalArgumentException | |
Don't know how to create ISeq from: clojure.lang.Keyword | |
RT.java: 505 clojure.lang.RT/seqFrom | |
RT.java: 486 clojure.lang.RT/seq | |
RT.java: 578 clojure.lang.RT/first | |
core.clj: 55 clojure.core/first | |
dependency_exclusions.clj: 32 immutant.dependency-exclusions/exclude-immutant-deps/fn/fn | |
core.clj: 1370 clojure.core/complement/fn | |
core.clj: 2605 clojure.core/filter/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
(defmacro build-test-call [nses format to-file output-file] | |
(let [format-fn (cond (= format "tap") | |
'clojure.test.tap/with-tap-output | |
(= format "junit") | |
'clojure.test.junit/with-junit-output | |
:else 'identity)] | |
(if to-file | |
`(quote (with-open [results# | |
(java.io.FileWriter. ~output-file)] | |
(binding [clojure.test/*test-out* results#] |
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
(defmacro build-test-call [nses format to-file output-file] | |
(let [format-fn (cond (= format "tap") | |
'clojure.test.tap/with-tap-output | |
(= format "junit") | |
'clojure.test.junit/with-junit-output | |
:else 'identity)] | |
(if to-file | |
`(quote (with-open [results# | |
(java.io.FileWriter. ~output-file)] | |
(binding [clojure.test/*test-out* results#] |