This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require_relative "rules" | |
# An object which represents the checkout process or cash register. | |
# It scans items, which are added to an internal list of items, | |
# which are then used to return the #total at any given moment. | |
# This total tries to use the rules which lead to the cheapest price. | |
class CheckOut < Struct.new(:rules) | |
attr_accessor :rules # list of available pricing rules (passed on initialization) | |
attr_accessor :items # hash of scanned items and quantities | |
# { "A" => 0, "B" => 1 } means we have scanned one "A" and zero "B"s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
At the end of your Blogger post , using HTML editor, append this | |
<script src="https://raw.github.com/moski/gist-Blogger/master/public/gistLoader.js" type="text/javascript"></script> | |
In the content of your blog post, simply add this: | |
<div class="gistLoad" data-id="8488564" id="gist-8488564">Loading https://gist.github.com/8488564....</div> | |
Note: adding the URL is useful because when the javascript does not work, readers can copy and paste the URL themselves. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GOCMD=go | |
GOTEST=$(GOCMD) test | |
GOVET=$(GOCMD) vet | |
BINARY_NAME=example | |
VERSION?=0.0.0 | |
SERVICE_PORT?=3000 | |
DOCKER_REGISTRY?= #if set it should finished by / | |
EXPORT_RESULT?=false # for CI please set EXPORT_RESULT to true | |
GREEN := $(shell tput -Txterm setaf 2) |