Skip to content

Instantly share code, notes, and snippets.

View Kungi's full-sized avatar

Andreas Klein Kungi

  • DemandFlow GmbH
  • Germany
View GitHub Profile
@Kungi
Kungi / gist:6312427
Created August 22, 2013 20:34
This is how I initialize yagist with evil mode and trailing whitespace mode
(require 'yagist)
(add-hook 'yagist-list-mode-hook
(lambda () (progn
(evil-emacs-state)
(turn-off-trailing-whitespace))))
@Kungi
Kungi / anonymous-gist.org
Created June 19, 2014 09:14
Vertical Ido

I like my completions in a vertical list rather than a horizontal line

;; Display ido results vertically, rather than horizontally
(setq ido-decorations (quote ("\n-> " "" "\n   " "\n   ..." "[" "]"
                           " [No match]" " [Matched]" " [Not readable]" " [Too big]" " [Confirm]")))

(defun ido-disable-line-trucation ()
  (set (make-local-variable 'truncate-lines) nil))

(add-hook 'ido-minibuffer-setup-hook
@Kungi
Kungi / anonymous-gist.clj
Created August 22, 2014 15:36
building the test call for fntest execute
(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
`(with-open [results#
(java.io.FileWriter. ~output-file)]
@Kungi
Kungi / anonymous-gist.clj
Created August 22, 2014 16:00
fntest 2
(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#]
@Kungi
Kungi / anonymous-gist.clj
Last active August 29, 2015 14:05
fntest 2
(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#]
@Kungi
Kungi / anonymous-gist.
Created September 5, 2014 12:16
(immutant.dev/add-dependencies! '[incanter.core "1.5.5"])
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
(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)))
@Kungi
Kungi / Querying the Uberjar
Last active August 29, 2015 14:07
Example /bootstrap//bootstrap.min.css
> $ 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
@Kungi
Kungi / gist:cb735bb33b117bb60a58
Created October 15, 2014 08:46
Frameworkless Web Development in Clojure
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
@Kungi
Kungi / anonymous-gist.clj
Created November 19, 2014 09:31
namespaces?
(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))