This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer
#cloud-config | |
# Set the hostname for this machine (takes precedence over hostname assigned by DHCP lease). | |
hostname: myhost | |
# Authorize SSH keys for the `rancher` sudoer user | |
ssh_authorized_keys: | |
- ssh-rsa AAA...ZZZ example1@rancher | |
struct Item { | |
var price: Int | |
var count: Int | |
} | |
enum VendingMachineError: ErrorType { | |
case InvalidSelection | |
case InsufficientFunds(coinsNeeded: Int) | |
case OutOfStock | |
} |
# Brett Terpstra 2014 | |
# <http://brettterpstra.com> | |
# | |
# tmux wrapper | |
# tm session-name [window-name] | |
# Names can be partial from the beginning and first match will connect. | |
# If no match is found a new session will be created. | |
# If there's a second argument, it will be used to attach directly to a | |
# window in the session, or to name the first window in a new session. | |
tm() { |
_tm_complete() { | |
local rx | |
local token=${COMP_WORDS[$COMP_CWORD]} | |
local IFS=$'\t' | |
local words | |
if [ $COMP_CWORD -eq 1 ]; then | |
words=$(tmux -q list-sessions 2> /dev/null | cut -f 1 -d ':' | tr "\n" " " | sed 's/ $//') | |
fi | |
if [ $COMP_CWORD -eq 2 ]; then | |
words=$(tmux list-windows -t ${COMP_WORDS[1]} 2> /dev/null | awk '{print $2}' | tr -d '*-' | tr "\n" " " | sed 's/ $//') |
This gist is part of a blog post. Check it out at:
http://jasonrudolph.com/blog/2011/08/09/programming-achievements-how-to-level-up-as-a-developer