Skip to content

Instantly share code, notes, and snippets.


Ben Schwartz benschw

View GitHub Profile
View Loose Coupling with Bounded

A good microservice should encapsulate a bounded context. A bounded context is a concept that comes from Domain-Driven Design (or DDD). In DDD, the components of an application are organized around the various contexts or domains in which your software can be interpreted.

As software gets larger, it becomes harder and harder to describe it with a unified model. Your software might serve three different departments in your company that each have their own definition for what a product is, or it might be used by two different types of customers. Describing all of these situations in a unified model is confusing and


Keybase proof

I hereby claim:

  • I am benschw on github.
  • I am benschw ( on keybase.
  • I have a public key whose fingerprint is 60D0 8AEE 4A44 9E1A E5A6 4111 5AB8 F227 980A 076C

To claim this, I am signing this object:

View vendor experiment with godep
go get
godep save ./...
# from (
# (fork campoy/cooltool on github)
go get
cd $GOHOME/src/campoy/cooltool
git remote add fork
# git commit
benschw /
Created Jul 9, 2015
ubild a gif from a screencast in linux
sudo apt-get install imagemagick mplayer gtk-recordmydesktop
mplayer -ao null output.ogv -vo jpeg:outdir=output
convert output/* output.gif
convert output.gif -coalesce -repage 0x0 -crop 1200x630+22+60 +repage output-crop.gif
convert output-crop.gif -fuzz 10% -layers Optimize output-crop-opt.gif
benschw /
Created Jun 26, 2015
script to bootstrap a single node consul service (e.g. for vagrant)
if [ ! -f /tmp/provisioned ]; then
apt-get update
apt-get install -y daemon wget unzip
touch /tmp/provisioned
View gist:44ab89627c4d3fd713bf
# echo '{"foo": "lorem", "bar": "ipsum"}' | python -m json.tool
alias jsonprint="python -m json.tool"
pushd ~
wget -q -O go1.3.linux-amd64.tar.gz
tar -xzf go1.3.linux-amd64.tar.gz
export GOROOT=~/go
export PATH=$GOROOT/bin:$PATH
rm -rf ~/go/src/pkg/appengine
rm -rf ~/go/src/pkg/appengine_internal
benschw / pipeline.go
Created Sep 15, 2014
concurent pipeline processing in go
View pipeline.go
package main
import (
var _ = log.Print