Skip to content

Instantly share code, notes, and snippets.

Ben Schwartz benschw

View GitHub Profile
View Loose Coupling with Bounded Contexts.md

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

View keybase.md

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:

View vendor experiment with godep
export GO15VENDOREXPERIMENT=1
go get github.com/tools/godep
godep save ./...
View golang-fork-howto.sh
# 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 Jul 9, 2015
ubild a gif from a screencast in linux
View screen2gif.sh
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 Jun 26, 2015
script to bootstrap a single node consul service (e.g. for vagrant)
View consul-bootstrap.sh
#!/bin/bash
if [ ! -f /tmp/provisioned ]; then
apt-get update
apt-get install -y daemon wget unzip
touch /tmp/provisioned
fi
View gist:44ab89627c4d3fd713bf
# echo '{"foo": "lorem", "bar": "ipsum"}' | python -m json.tool
alias jsonprint="python -m json.tool"
View go1.3-on-drone.sh
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 Sep 15, 2014
concurent pipeline processing in go
View pipeline.go
package main
import (
"log"
"strconv"
"time"
)
var _ = log.Print
You can’t perform that action at this time.