Skip to content

Instantly share code, notes, and snippets.

View juque's full-sized avatar

Juan Pablo Aqueveque juque

View GitHub Profile

Shopping cart, Event Sourcing style

This is an example of how to interact with a shopping cart by emitting actions or events.

A processor object dispatches incoming events to susbcribers, who are in charge of mutating data (an order in this case).

Run a simple user session that interacts with the cart with

ruby user_session.rb
@ismasan
ismasan / themes.rb
Last active December 15, 2016 13:40
Backup a Bootic theme using the Bootic CLI
require "fileutils"
require "open-uri"
require "thread"
require "listen"
# dependencies:
# gem install listen
#
# Put this file in ~/btc/themes.rb
# Theme management
@ismasan
ismasan / image_backup.rb
Last active May 9, 2017 00:43
Backup all product images in a Bootic shop
# gem install thread
#
# run with:
# SUBDOMAIN=foobar btc runner image_backup.rb
#
require 'open-uri'
require 'fileutils'
require "thread/pool"
require "logger"