Skip to content

Instantly share code, notes, and snippets.

@aaronblenkush
aaronblenkush / cache.clj
Last active Jul 25, 2019
clojure.core.cache pattern
View cache.clj
;; There is a subtle problem with the official clojure.core.cache
;; example (https://github.com/clojure/core.cache/wiki/Using):
(defn get-data [key]
(cache/lookup (swap! cache-store
#(if (cache/has? % key)
(cache/hit % key)
(cache/miss % key (retrieve-data key))))
key))
View git-multi-status.sh
#!/bin/bash
# usage: $0 source_dir [source_dir] ...
# where source_dir args are directories containing git repositories
red="\033[00;31m"
green="\033[00;32m"
yellow="\033[00;33m"
blue="\033[00;34m"
purple="\033[00;35m"
View fancy-prompt.sh
function _fancy_prompt {
local RED="\[\033[01;31m\]"
local GREEN="\[\033[01;32m\]"
local YELLOW="\[\033[01;33m\]"
local BLUE="\[\033[01;34m\]"
local WHITE="\[\033[00m\]"
local PROMPT=""
# Working directory