Instantly share code, notes, and snippets.

View kong-ingres.yml
apiVersion: configuration.konghq.com/v1
kind: KongIngress
metadata:
name: drone-drone
labels:
app: drone
component: server
release: drone
route:
preserve_host: true
View create-kms-secret.sh
#!/usr/bin/env sh
KEY=$1
VALUE=$2
INIT=$3
: "${KEYRING:=global}"
: "${LOCATION:=global}"
: "${SERVICE_ACCOUNT:?Variable not set or empty}"
gcloud () {
View gcloud
#!/usr/bin/env sh
docker run --rm \
-t $([[ -t 0 ]] && echo "-i") \
-w /workspace \
-v "$PWD:/workspace" \
-v /usr/bin/docker:/usr/bin/docker \
-v /var/run/docker.sock:/var/run/docker.sock \
-v kube-data:/root \
gcr.io/cloud-builders/gcloud "$@"
View package.json
{
"name": "name",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"scripts": {
"build": "babel src -d dist/ --ignore '**/*.test.js'",
"test": "ava",
"flow": "flow"
},
View gist:c2329d4107c60a7bba16c53605f80ddc
#### Issue description
#### Steps to reproduce the issue
1.
2.
3.
View kube-port-foward
#!/bin/bash
readonly PROGNAME=$(basename $0)
default_since="10s"
default_namespace="default"
default_line_buffered=""
default_colored_output="pod"
line_buffered="${default_line_buffered}"
View normalizer.js
import { concat, zipObj, keys, values, map, isEmpty, curry } from 'ramda'
const log = curry(console.log)
const snakeCaseObj = [{
a_b: "asdasdasd",
c_a: "2018-02-20T18:43:17.104Z",
t_c: {
s_d: "2018-02-20",
e_d: "2018-02-20",
b_t: {
c_a: "2018-02-20T18:43:17.104Z"
View cheat-sheet.org

Emacs Evil-Mode Cheat Sheet

Workflow

  • Open emacs, Use terminal with tmux for shell things, use emacs to file processing

Base

  • `C-x`, `SPC` Shortcuts
  • `M-x`, `S-:` Commands
View chain.js
// TL;DR
// return arrays
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/all
// http://stackoverflow.com/questions/28250680/how-do-i-access-previous-promise-results-in-a-then-chain
// http://stackoverflow.com/questions/22892681/what-patterns-are-there-for-passing-state-through-a-chain-of-promises-in-javascr
// http://bluebirdjs.com/docs/api/spread.html
// You design your api like aways, put when you want to pass a value, you pass Promise.all, and you do this in
// process of chaining it, your api, doesn't need to be awere of promises
View sample.hs
-- This that the function toInt takes a String and returns a Integer
toInt :: String -> Int
-- This means that the function run takes 'a' and returns a 'b'
run :: a -> b
-- https://www.fpcomplete.com/blog/2012/09/ten-things-you-should-know-about-haskell-syntax
-- http://stackoverflow.com/questions/5926826/what-does-double-colon-stand-for-in-haskell