Skip to content

Instantly share code, notes, and snippets.

Thomas Engelschmidt zamaterian

Block or report user

Report or block zamaterian

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View Onyx-lib replica state
{: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 Jan 20, 2016
Clojure in neovim, using neovims terminal to communication with lein repl in a split window, instead of tmux.
View clojure-repl.vim
" 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 Jan 20, 2016
Run a single clojure test within a fixture from vim
View clojure.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 Jan 15, 2016
Example of our rest-api that combines liberator with compojure-api
View gist:53cc25e71d5104515e76
(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"]
View sample.clj
(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]
View gist:dfbafbeef178daf5c21b
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 Dec 23, 2015
Running juniper from a linux on a juniper without a http brower session.
View gist:6681534
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 Dec 23, 2015
efi boot linux on mac
View gist:6561135
# 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
reload clojure namespace
View clj
(defonce ignored-namespaces (atom #{}))
(defn reload-all []
(doseq [n (remove (comp @ignored-namespaces ns-name) (all-ns))]
(require (ns-name n) :reload )))
@zamaterian
zamaterian / atom.xml
Created Mar 8, 2012
hacks of zip xml
View atom.xml
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title>Example Feed</title>
<subtitle>A subtitle.</subtitle>
<link href="http://example.org/feed/" rel="self" />
<link href="http://example.org/" />
<id>urn:uuid:60a76c80-d399-11d9-b91C-0003939e0af6</id>
<updated>2003-12-13T18:30:02Z</updated>
You can’t perform that action at this time.