bin/kafka-topics.sh --zookeeper localhost:2181 --list
bin/kafka-topics.sh --zookeeper localhost:2181 --describe --topic mytopic
bin/kafka-topics.sh --zookeeper localhost:2181 --alter --topic mytopic --config retention.ms=1000
... wait a minute ...
bin/kafka-topics.sh --zookeeper localhost:2181 --list
bin/kafka-topics.sh --zookeeper localhost:2181 --describe --topic mytopic
bin/kafka-topics.sh --zookeeper localhost:2181 --alter --topic mytopic --config retention.ms=1000
... wait a minute ...
| # | |
| # CORS header support | |
| # | |
| # One way to use this is by placing it into a file called "cors_support" | |
| # under your Nginx configuration directory and placing the following | |
| # statement inside your location block(s): | |
| # | |
| # include cors_support; | |
| # | |
| # A limitation to this method is that Nginx doesn't currently send headers |
| (defn invoke-private-method [obj fn-name-string & args] | |
| (let [m (first (filter (fn [x] (.. x getName (equals fn-name-string))) | |
| (.. obj getClass getDeclaredMethods)))] | |
| (. m (setAccessible true)) | |
| (. m (invoke obj args)))) | |
| (defn private-field [obj fn-name-string] | |
| (let [m (.. obj getClass (getDeclaredField fn-name-string))] | |
| (. m (setAccessible true)) | |
| (. m (get obj)))) |
In this gist I would like to describe an idea for GraphQL subscriptions. It was inspired by conversations about subscriptions in the GraphQL slack channel and different GH issues, like #89 and #411.
At the moment GraphQL allows 2 types of queries:
querymutationReference implementation also adds the third type: subscription. It does not have any semantics yet, so here I would like to propose one possible semantics interpretation and the reasoning behind it.
(:identity req) is auth backend independent way to access user data:current-user doesn't imply that authentication is required, route should also have :auth-rules if authentication is required| #!/bin/bash | |
| # | |
| # This script will mount /Users in the boot2docker VM using NFS (instead of the | |
| # default vboxsf). It's probably not a good idea to run it while there are | |
| # Docker containers running in boot2docker. | |
| # | |
| # Usage: sudo ./boot2docker-use-nfs.sh | |
| # |
| (require '[clojure.core.async :as a]) | |
| (def xform (comp (map inc) | |
| (filter even?) | |
| (dedupe) | |
| (flatmap range) | |
| (partition-all 3) | |
| (partition-by #(< (apply + %) 7)) | |
| (flatmap flatten) | |
| (random-sample 1.0) |
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.
| (def inputs [{:korks :email} | |
| {:korks [:name :first]} | |
| {:korks [:name :last]}]) | |
| (defn form [app owner] | |
| (reify | |
| om/IInitState | |
| (init-state [this] | |
| (reduce (fn [state {:keys [korks]}] | |
| (assoc-in state korks nil)) |
| (ns client.views.graph | |
| (:require-macros [cljs.core.async.macros :refer [go]] ) | |
| (:require [strokes :refer [d3]] | |
| [dommy.utils :as utils] | |
| [dommy.core :as dommy] | |
| [cljs-time.core :as t :refer [now plus minutes hours]] | |
| [cljs-time.coerce :refer [to-long from-long]] | |
| [cljs.core.async :as async :refer [<! >! chan]] | |
| [om.dom :as dom :include-macros true] | |
| [om.core :as om :include-macros true] |