Skip to content

Instantly share code, notes, and snippets.

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
#!/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"
@aaronblenkush
aaronblenkush / cache.clj
Last active July 25, 2019 17:30
clojure.core.cache pattern
;; 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))