curl -X POST https://discovery.hub.docker.com/v1/clusters
YOURSWARMTOKEN
import operator | |
import re | |
def pairs(l): | |
return zip(l[::2], l[1::2]) | |
def vm(ops, env={}): | |
class closure: | |
def __init__(self, pc, env): self.pc, self.env = pc, env | |
def popn(n): |
$ export RANCHER_HOST=foo.bar.suf | |
$ export RANCHER_PORT=8080 | |
$ export RANCHER_PROJECT_ID=1a8 | |
$ export RANCHER_STACK_NAME=killerapp | |
$ ./cattle-deploy.py | |
output: | |
snapshot epoch is1437634695 | |
created temp file /var/folders/sx/ht6gznq979v5r725sqt7_p617p38sz/T/tmpprzZsd |
echo "Flipping tables! (╯°□°)╯︵ ┻━┻" | |
num_rules=3 | |
real=3 # exposed to the ELB as port 443 | |
test=4 # used to install test certs for domain verification | |
health=5 # used by the ELB healthcheck | |
blue_prefix=855 | |
green_prefix=866 |
py.test test_sample.py --collect-only # collects information test suite | |
py.test test_sample.py -v # outputs verbose messages | |
py.test -q test_sample.py # omit filename output | |
python -m pytest -q test_sample.py # calling pytest through python | |
py.test --markers # show available markers |
Simply put, destructuring in Clojure is a way extract values from a datastructure and bind them to symbols, without having to explicitly traverse the datstructure. It allows for elegant and concise Clojure code.
(ns inputstream.core | |
(:require [clojure.java.io :as io])) | |
(defn read-is [^java.io.InputStream is] | |
(let [bufsize 8192 | |
buf (byte-array bufsize)] | |
(loop [total-len 0] | |
(let [n (.read is buf)] | |
(cond |