Skip to content

Instantly share code, notes, and snippets.

(require '[boot.pod :as pod]
'[boot.tmpdir :as tmpdir]
'[clojure.java.io :as io]
'[clojure.string :as string])
(task-options!
pom {:project 'steinmetz
:version "0.1.0"}
repl {:init-ns 'user}
aot {:namespace #{}}
def find_ip ():
# we get a UDP-socket for the TEST-networks reserved by IANA.
# It is highly unlikely, that there is special routing used
# for these networks, hence the socket later should give us
# the ip address of the default route.
# We're doing multiple tests, to guard against the computer being
# part of a test installation.
candidates = []
for test_ip in ["192.0.2.0", "198.51.100.0", "203.0.113.0"]:
(deftask dev-repl
"start development repl"
[]
(comp (dev-profile) (repl)))
@schmir
schmir / jdbc_streaming.clj
Created July 5, 2017 12:25
streaming responses in java.jdbc
(ns soka-trb.jdbc-streaming
"streaming results in clojure.java.jdbc, when {:use-streaming? true} is passed
as option
hooks into jdbc/prepare-statements and calls turn-on-streaming
Users need to extend the TurnOnStreaming protocol for their databases
"
(:require [clojure.java.jdbc :as jdbc]
[robert.hooke]))
@schmir
schmir / .sh
Created January 31, 2019 11:13
show git status on tab key
# When Tab is pressed on an empty(!) command line, the contents of the
# directory are printed (`ls`) instead of a menu list of all
# executables:
function my-hg-report() {
tip=$(hg tip 2> /dev/null) || return
echo
hg --config pager.pager= status
echo
hg --config pager.pager= log --limit 5 --style compact