Skip to content

Instantly share code, notes, and snippets.

Hacking on @yetibot

Trevor Hartman devth

Hacking on @yetibot
View GitHub Profile
View xkcd.clj
(defn xkcd-cmd
"xkcd # fetch current xkcd comic"
{:yb/cat #{:fun :img}}
((juxt :title :img :alt) (get-json endpoint)))
(defn xkcd-idx-cmd
"xkcd <index> # fetch xkcd number <index>"
{:yb/cat #{:fun :img}}
[{index :match}]

Yetibot usage fundamentals

Instead of working through Yetibot's primitives and its many individual capabilities we'll start with a non trivial expression that's made up of several levels of nested aliases composed of piped commands. This will better illustrate how such primitives can be combined into something useful fun.

es_query() {
port="${port?$port must be set}"
pass="${pass?$pass must be set}"
query="${1?Query argument is required}"
curl -i -u "elastic:$pass" -XGET \
-H 'Content-Type: application/json' \
"https://localhost:$port/patient/_search?pretty" -d "
\"query\": {
\"match\": {
View onename
Verifying that "" is my Blockstack ID.
View Makefile
compile: clean
# -m / --multi <dir> Write multiple files to the directory, list files on stdout
jsonnet $(JSONNET_ARGS) -m $(BUILD_DIR) $(TF_FILE)
show: compile
jsonnet $(JSONNET_ARGS) $(TF_FILE)
rm -f $(BUILD_DIR)/*.tf.json
rm -f $(BUILD_DIR)/*.tfplan
View wrap-problem.clj
"This validates that we have enough information and correct information in our clojure.specs and
extra-datomic-schema that conforms to how we are modeling our domain, including:
1. That there is a one-to-one correspondence between 'kind' clojure.specs in the spec registry and the 'kind'
information in `extra-datomic-schema`.
View grommet.js
This file has been truncated, but you can view the full file.
this["grommet"] =
/* 0 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
View vault-statefulset.yaml
apiVersion: apps/v1beta1
kind: StatefulSet
name: {{.Chart.Name}}
serviceName: {{.Chart.Name}}-headless
replicas: {{.Values.vault.replicas}}
devth / spec.cljs
Last active Feb 21, 2017 — forked from swannodette/spec.cljs query spec
View spec.cljs
(:require [cljs.spec :as s]))
(s/def ::ident (s/and vector? (s/cat :ident keyword? :value #(not (coll? %)))))
(s/def ::join-key (s/or :prop keyword? :ident ::ident))
(s/def ::join (s/map-of ::join-key ::query))
(s/def ::union (s/map-of keyword? (s/map-of keyword? ::query)))
(s/def ::param-expr
#!/usr/bin/env bash
if [[ "$1" == '-h' ]] || [[ $# != 1 ]]; then
echo "Usage: $(basename "$0") <nodepool>"
echo "<nodepool> can be a partial match to grep for, e.g. '2016-08-19'"
echo "NOTE: Before draining all nodes in the old pool should be cordoned!"
exit 1;
You can’t perform that action at this time.