Skip to content

Instantly share code, notes, and snippets.

View dkua's full-sized avatar

David Kua dkua

  • Toronto, ON, Canada
View GitHub Profile
@dkua
dkua / consul_handler.rb
Created February 1, 2018 15:19 — forked from blalor/consul_handler.rb
Chef report handler for Consul
## chef report handler for Consul
## depends on a chef-client check being registered with the agent
## • pings TTL-style check with ok/warning status on chef run pass/fail
## • stores run report and node attributes in chef/reports/<datacenter>/<consul_node_name>
require "chef/handler"
require "rest_client"
class ConsulHandler < Chef::Handler
attr_reader :config
@dkua
dkua / README.md
Created December 21, 2018 23:06 — forked from joyrexus/README.md
collapsible markdown

collapsible markdown?

CLICK ME

yes, even hidden code blocks!

print("hello world!")
@dkua
dkua / .gitconfig
Last active July 29, 2020 17:23
safebase – git alias for backing up branch before rebasing
[alias]
# Returns name of current branch
# Usage: git current
current = rev-parse --abbrev-ref HEAD
# Makes a full copy of the current branch with `backup.<epoch>` appended before doing an interactive rebase
# Usage: git safebase HEAD~2
safebase = !CURRENT=$(git current) && git branch -c $CURRENT $CURRENT.backup.$(date +%s) && git rebase -i