Skip to content

Instantly share code, notes, and snippets.

View benschw's full-sized avatar

Ben Schwartz benschw

View GitHub Profile

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 (https://keybase.io/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:

export GO15VENDOREXPERIMENT=1
go get github.com/tools/godep
godep save ./...
# from (http://blog.campoy.cat/2014/03/github-and-go-forking-pull-requests-and.html)
# (fork campoy/cooltool on github)
go get github.com/campoy/cooltool
cd $GOHOME/src/campoy/cooltool
git remote add fork https://github.com/benschw/cooltool.git
# git commit
@benschw
benschw / screen2gif.sh
Created July 9, 2015 15:15
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
benschw / consul-bootstrap.sh
Created June 26, 2015 16:34
script to bootstrap a single node consul service (e.g. for vagrant)
#!/bin/bash
if [ ! -f /tmp/provisioned ]; then
apt-get update
apt-get install -y daemon wget unzip
touch /tmp/provisioned
fi
@benschw
benschw / gist:44ab89627c4d3fd713bf
Created January 21, 2015 04:52
pretty print in json
# 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 http://golang.org/dl/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
popd
@benschw
benschw / pipeline.go
Created September 15, 2014 21:41
concurent pipeline processing in go
package main
import (
"log"
"strconv"
"time"
)
var _ = log.Print