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
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
#!/usr/bin/env bash
if [[ "$1" == '-h' ]] || [[ $# != 1 ]]; then
echo "Usage: $(basename "$0") <nodepool>"
echo
echo "<nodepool> can be a partial match to grep for, e.g. '2016-08-19'"
echo
echo "NOTE: Before draining all nodes in the old pool should be cordoned!"
exit 1;
fi
kubectl --namespace kube-system get pod -l k8s-app=kube-dns -oname | \
xargs -I% -n1 sh -c 'echo %; kubectl --namespace kube-system -ckubedns logs %; echo'
(reduce
(fn [acc i]
(update-in
acc [i]
(fn [x y] (prn x y) (+ y (or x 0)))
(* 2 i)))
{}
[1 2 3 4 1])
use std::fs;
use std::io;
use std::path::PathBuf;
fn main() {
let dir = env!("DIR").to_string();
println!("Looking in {}", dir);
let _ = loop_dir_contents(&dir);
}
@devth
devth / install_kubectl.sh
Last active May 19, 2016 20:06
Obtain metadata in pods
# Useful for installing kubectl in a docker image
curl -L -O https://storage.googleapis.com/kubernetes-release/release/v1.2.4/bin/linux/amd64/kubectl
# obtain the node name inside a pod
KUBERNETES_NODENAME=`kubectl get pods --namespace=${KUBERNETES_NAMESPACE} ${KUBERNETES_PODNAME} -o json | jq -r .spec.nodeName`
[merge]
tool = opendiff
[core]
excludesfile = /Users/trevorhartman/.gitignore
editor = vim
[alias]
st = status -sb
ci = commit
co = checkout
br = branch
val cost: Option[String] = Some("123")
val method: Option[String] = None
(cost, method) match {
case (Some(c), Some(m)) => Some(s"$c $m")
case (Some(c), None) => Some(s"$c")
case (None, Some(m)) => Some(s"$m")
case _ => None
}