added the patters example in the tutorial and updated the gist