Skip to content

Instantly share code, notes, and snippets.

; A REPL-based, annotated Seesaw tutorial
; Please visit https://github.com/daveray/seesaw for more info
;
; This is a very basic intro to Seesaw, a Clojure UI toolkit. It covers
; Seesaw's basic features and philosophy, but only scratches the surface
; of what's available. It only assumes knowledge of Clojure. No Swing or
; Java experience is needed.
;
; This material was first presented in a talk at @CraftsmanGuild in
; Ann Arbor, MI.

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name:

# Add multimedia source
echo "deb http://www.deb-multimedia.org wheezy main non-free" >> /etc/apt/sources.list
echo "deb-src http://www.deb-multimedia.org wheezy main non-free" >> /etc/apt/sources.list
apt-get update
apt-get install deb-multimedia-keyring # if this aborts, try again
apt-get update
# Go to local source directory
cd /usr/local/src
@nwalker
nwalker / constants.ex
Last active May 18, 2019 01:37 — forked from smpallen99/constants.ex
Approach for constants shared between modules in Elixir
defmodule Constants do
defmodule Extractor do
require Record
Record.defrecord :tree, [:type, :pos, data: :undefined]
Record.defrecord :attr, :attribute, [:name, :args]
def extract(opts) do
cond do
lib = opts[:from_lib] -> from_lib_file(lib)
file = opts[:from_file] -> from_file(file)
@nwalker
nwalker / run.tpl
Created February 20, 2018 14:09 — forked from hervenicol/run.tpl
`docker inspect` template to regenerate the `docker run` command that created a container
docker run \
--name={{.Name}} \
{{range $e := .Config.Env}}--env={{printf "%q" $e}} \
{{end}}{{range $p, $conf := .NetworkSettings.Ports}}{{with $conf}}-p {{(index $conf 0).HostIp}}:{{(index $conf 0).HostPort}}:{{$p}} \
{{end}}{{end}}{{range $n, $conf := .NetworkSettings.Networks}}{{with $conf}}--network {{printf "%q" $n}} \
{{range $conf.Aliases}}--network-alias {{printf "%q" .}} {{end}} \
{{end}}{{end}}{{range $v := .HostConfig.VolumesFrom}}--volumes-from={{printf "%q" .}} \
{{end}}{{range $v := .HostConfig.Binds}}--volume={{printf "%q" .}} \
{{end}}{{range $l, $v := .Config.Labels}}--label {{printf "%q" $l}}={{printf "%q" $v}} \
{{end}}{{range $v := .HostConfig.CapAdd}}--cap-add {{printf "%q" .}} \
def show(conn, _params) do
invoice_id = get_session(conn, :invoice_id)
invoice_access_token = get_session(conn, :access_token)
cond
is_nil(invoice_id) or is_nil(invoice_access_token) -> render_error(conn, _params)
_ -> render_form(conn, invoice_id, invoice_access_token)
end
end