This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
docker@boot2docker:~$ sudo iptables -L | |
Chain INPUT (policy ACCEPT) | |
target prot opt source destination | |
Chain FORWARD (policy ACCEPT) | |
target prot opt source destination | |
ACCEPT tcp -- anywhere 172.17.0.3 tcp dpt:smtp | |
ACCEPT tcp -- anywhere 172.17.0.2 tcp dpt:smtp | |
ACCEPT all -- anywhere anywhere ctstate RELATED,ESTABLISHED | |
ACCEPT all -- anywhere anywhere |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns flow-control | |
(:require [clojure.core.async :as async :refer :all | |
:exclude (map merge partition-by partition unique take into reduce split)])) | |
;; flow control through a "turnstile" | |
;; kind of like an extensible circuit breaker | |
;; Overview -- | |
;; Your program's processes are like people entering a subway, | |
;; but the central authority only allows certain tickets in. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns weighted-rand | |
(:import clojure.lang.PersistentQueue)) | |
(defprotocol Rand | |
(nextr [_ rng])) | |
;; Vose's alias method | |
;; http://www.keithschwarz.com/darts-dice-coins/ | |
(deftype Vose [n ^ints alias ^doubles prob] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn result-set | |
[^ResultSet rs & {:keys [identifiers] | |
:or {identifiers str/lower-case}}] | |
(reify clojure.lang.IReduce | |
(reduce [this f] | |
(reduce [this f (f)])) | |
(reduce [this f init] | |
(let [rsmeta (.getMetaData rs) | |
idxs (range 1 (inc (.getColumnCount rsmeta))) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(let* | |
[c__6072__auto__ | |
(clojure.core.async/chan 1) | |
captured-bindings__6073__auto__ | |
(clojure.lang.Var/getThreadBindingFrame)] | |
(clojure.core.async.impl.dispatch/run | |
(clojure.core/fn | |
[] | |
(clojure.core/let | |
[f__6074__auto__ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import clojure.lang.RT; | |
import clojure.lang.IFn; | |
import clojure.lang.AFn; | |
import java.util.Iterator; | |
import java.util.ArrayList; | |
import java.util.NoSuchElementException; | |
public class XFIterator implements Iterator { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns poolboy.chanfut | |
(:import [java.util.concurrent CompletableFuture Callable Future] | |
[java.util.function BiConsumer] | |
[java.util.concurrent Executor ExecutorService]) | |
(:require [clojure.core.async :as async] | |
[clojure.core.async.impl.protocols :as async-impl])) | |
(def async-executor clojure.core.async.impl.exec.threadpool/the-executor) | |
(defprotocol Interruptible |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(def JSON '{json [whitespace value EOI] | |
value (/ string number object array jtrue jfalse jnull) | |
object [(:ws "{") | |
(:join [string (:ws ":") value] ",") | |
(:ws "}") | |
(action capture-object)] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns docker-tag-paginate | |
(:require [clj-http.lite.client :as client] | |
[cheshire.core :as json] | |
[clojure.pprint :refer [print-table]])) | |
(def base-url "https://registry.hub.docker.com/v2") | |
;; (progression pos? dec 15) | |
(defn progression |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defmacro doseqs | |
[seq-exprs & body] | |
(let [stk (gensym "stack__") | |
level (gensym "level__") | |
seq-exprs (partition 2 seq-exprs) | |
bindings (vec (map first seq-exprs)) | |
init-exprs (vec (map second seq-exprs)) | |
nbinds (count init-exprs) |