Skip to content

Instantly share code, notes, and snippets.

@gerrit-hntschl
gerrit-hntschl / threadcount.sh
Created June 7, 2017 09:32
Terminal number of threads
ps -o nlwp <pid>
@gerrit-hntschl
gerrit-hntschl / gist:3d10fa5985b484e57ea1
Last active August 29, 2015 14:01
Higher order functions - retries with exponential backoff
(defn retryable
"Returns a function that retries f up to max-attempts, with exponentially
increasing delay, when pred returns truthy for a raised exception.
If max-attempts has been exceeded failure-handler (if any)
is invoked with the exception and arguments of f, in that order.
failure-handler must return an exception."
[f pred & {:keys [failure-handler
max-attempts
backoff-millis]
:or {failure-handler (fn [ex & _] ex)
@gerrit-hntschl
gerrit-hntschl / 0_reuse_code.js
Created May 25, 2014 14:16
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console