Skip to content

Instantly share code, notes, and snippets.

View zamaterian's full-sized avatar

Thomas Engelschmidt zamaterian

View GitHub Profile
@zamaterian
zamaterian / git-completion.sh
Created October 29, 2010 08:13
git bash completion scrpt
#
# bash completion support for core Git.
#
# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
# Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
# Distributed under the GNU General Public License, version 2.0.
#
# The contained completion routines provide support for completing:
#
# *) local and remote branch names
@zamaterian
zamaterian / unison - setup
Created December 24, 2010 16:53
unison setup and tips with ssh
http://greek0.net/secure_unison.html
@zamaterian
zamaterian / bashrc
Created December 13, 2011 13:08
Clojure highlightning for cli less via source-hightlight
# add to .bashrc or .profile
export LESSOPEN="| /usr/share/source-highlight/src-hilite-lesspipe.sh %s"
export LESS=' -R '
@zamaterian
zamaterian / atom.xml
Created March 8, 2012 08:16
hacks of zip 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>
@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 )))
@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 / 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
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
(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]
@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"]