Skip to content

Instantly share code, notes, and snippets.

View zamaterian's full-sized avatar

Thomas Engelschmidt zamaterian

View GitHub Profile
@zamaterian
zamaterian / keybase.md
Created December 8, 2019 16:10
keybase.md

Keybase proof

I hereby claim:

  • I am zamaterian on github.
  • I am zamaterian (https://keybase.io/zamaterian) on keybase.
  • I have a public key ASBptsXYt-CY51WgeYJGNXtY4Ba2aSoa9X68TrUzGYO3OAo

To claim this, I am signing this object:

{:as-of-entry 70,
:as-of-timestamp 1473787430350,
:entry {:args {:acker-exclude-inputs false,
:acker-exclude-outputs false,
:acker-percentage 1,
:exempt-tasks (),
:flux-policies {},
:id #uuid "00000000-c35f-0816-0000-000077cb05ee",
:inputs (:partition-keys),
:min-required-peers {:partition-keys 1,
@zamaterian
zamaterian / clojure-repl.vim
Created January 20, 2016 09:43
Clojure in neovim, using neovims terminal to communication with lein repl in a split window, instead of tmux.
" requires neovim
"https://github.com/neovim/neovim/pull/2076#issuecomment-77793644
if has("nvim")
tnoremap <Leader>e <C-\><C-n>
tnoremap <C-Enter> startinsert
au TermOpen * let g:last_term_job_id = b:terminal_job_id
endif
function! SendToTerm(lines)
@zamaterian
zamaterian / clojure.vim
Created January 20, 2016 09:14
Run a single clojure test within a fixture from vim
" depends on vim-fireplace
function! ClojureTestFixture() abort
"Eval the toplevel clojure form (a deftest) and then test-var the result.
"http://blog.venanti.us/clojure-vim/
normal! ^
let line1 = searchpair('(','',')', 'bcrn', g:fireplace#skip)
let line2 = searchpair('(','',')', 'rn', g:fireplace#skip)
let expr = join(getline(line1, line2), "\n")
let var = fireplace#session_eval(expr)
@zamaterian
zamaterian / gist:53cc25e71d5104515e76
Created January 15, 2016 14:41
Example of our rest-api that combines liberator with compojure-api
(def auth-base-api
[:service-available? workaround-missing-mediatype
:handle-unauthorized unauthorized-handler
:authorized? authorized?
:allowed? allowed?
:available-media-types (conj available-media-types "application/json")
:handle-exception exception-handler
:processable? parse-and-coerce-body
:handle-unprocessable-entity unprocessable
:available-charsets ["utf-8"]
(defn resolve-symbol-value [sym]
;todo catch execptions and rethrow with sym name
(if (symbol? sym)
(var-get (resolve sym))
sym))
(defmulti restructure-swagger
(fn [method swagger-map liberator-map] (prn method) method))
(defmethod restructure-swagger :get [_ swagger-map liberator-map]
in .nvimrc add
" requires vim-fireplace
au TermOpen * let g:last_term_job_id = b:terminal_job_id
function! SendToTerm(lines)
call jobsend(g:last_term_job_id, add(a:lines, ''))
endfunction
@zamaterian
zamaterian / gist:6681534
Last active December 23, 2015 19:19
Running juniper from a linux on a juniper without a http brower session.
Bases upon.
-- http://mad-scientist.us/juniper.html
Debs to be installed on ubuntu
xterm
libc6:i386
zlib1g:i386
libgtk2-perl
libwww-perl
@zamaterian
zamaterian / gist:6561135
Last active December 23, 2015 01:29
efi boot linux on mac
# Create linux boot disk :
sudo dd if=/home/te/Downloads/linuxmint-17-mate-64bit-v2.iso of=/dev/sdc1 bs=4k
# disable boot sound on os x
Just open up the Terminal application, you can find it in “Applications” -> “Terminal,” and enter the following on the command line:
sudo nvram SystemAudioVolume=%80
@zamaterian
zamaterian / clj
Created May 15, 2012 12:38
reload clojure namespace
(defonce ignored-namespaces (atom #{}))
(defn reload-all []
(doseq [n (remove (comp @ignored-namespaces ns-name) (all-ns))]
(require (ns-name n) :reload )))