Skip to content

Instantly share code, notes, and snippets.

@prozz
prozz / docker-bash.sh
Created April 4, 2018 09:49
run bash in docker container matching given string
#!/bin/bash
name="${1?needs one argument}"
containerId=$(docker ps | grep $name | grep -o '^\w\+')
if [ $(echo $containerId | wc -w) -gt 1 ];
then
echo "Multiple docker containers found for: $name"
exit 1
fi
@prozz
prozz / wants.txt
Last active August 29, 2015 14:15
l5r wants
# Dynasty
# Stronghold
1 The Fruitful Port of the Mantis (foil)
# Sensei
# Event
# Holding
@prozz
prozz / adventures.clj
Last active December 30, 2015 02:19
clojure adventures
how to get from [{:text "AAA", :code "0011"}] to {11 {:text "AAA", :code "0011"}}
note that key in result is made with use of following function:
=> (code->int "00123")
123
=> (def t [{:code "0011" :text "AAA"}])
[{:text "AAA", :code "0011"}]
=> (into {} (map identity t))
{:text "AAA", :code "0011"}