Skip to content

Instantly share code, notes, and snippets.

View devth's full-sized avatar
Hacking on @yetibot

Trevor Hartman devth

Hacking on @yetibot
View GitHub Profile
118
121
123
125
134
132
137
135
136
137
(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.

!yetishould
@devth
devth / es_query.sh
Last active September 11, 2017 18:21
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\": {
Verifying that "devth_.id" is my Blockstack ID. https://onename.com/devth_
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)
clean:
rm -f $(BUILD_DIR)/*.tf.json
rm -f $(BUILD_DIR)/*.tfplan
"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`.
"
This file has been truncated, but you can view the full file.
this["grommet"] =
webpackJsonp_name_([1],[
/* 0 */
/***/ function(module, exports, __webpack_require__) {
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
---
apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
name: {{.Chart.Name}}
spec:
serviceName: {{.Chart.Name}}-headless
replicas: {{.Values.vault.replicas}}
template:
metadata:
@devth
devth / spec.cljs
Last active February 21, 2017 00:16 — forked from swannodette/spec.cljs
om.next query spec
(ns om.next.spec
(: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