Put flip
somewhere in your $PATH
and chmod a+x
it.
Copy fuck
into ~/.bashrc
.
#!/bin/bash | |
# SSH into a Vagrant VM, forwarding ports in a way that allows node within Vagrant to be debugged by a debugger | |
# or IDE in the host operating system. Don't know why, but Vagrantfile port forwarding does not work. | |
# (https://groups.google.com/forum/#!topic/vagrant-up/RzPooJ0dp6Q) | |
/usr/bin/vagrant ssh-config > $TMPDIR/vagrant-ssh-config | |
ssh -F $TMPDIR/vagrant-ssh-config -L 5858:127.0.0.1:5858 default | |
rm $TMPDIR/vagrant-ssh-config |
#!/usr/bin/env bash | |
# finds all sprint tags (like @sprint:42) and runs them in a reversed order (won't run not tagged scenarios) | |
PARALLEL_COMMAND='parallel --gnu' | |
#PARALLEL_COMMAND='xargs -I{}' | |
BEHAT_COMMAND='./bin/behat --ansi --tags={}' | |
grep '@sprint:' features/*.feature | sed -e 's/.*\(@sprint:[0-9]*\).*/\1/' | sort -ur | $PARALLEL_COMMAND $BEHAT_COMMAND |
module InventoryItems(Command(..), Event(..), handle) where | |
import Data.Maybe(isJust) | |
type Id = String | |
type Name = String | |
type Amount = Int | |
data Command = CreateInventoryItem Id | |
| RenameInventoryItem Id Name |
// Udi style w Static Domain Events | |
var dispatcher = new RecordingDomainEventsDispatcher(); | |
DomainEvents.Dispatcher = dispatcher; | |
var customer = new Customer(new Address()); | |
customer.Move(new Address()); | |
Console.WriteLine("Customer moved: " + dispatcher.RecordedDomainEvent(new CustomerMoved())); |
#!/usr/bin/env bash | |
# names of latest versions of each package | |
export NGINX_VERSION=1.15.5 | |
export VERSION_NGINX=nginx-$NGINX_VERSION | |
export VERSION_LIBRESSL=libressl-2.8.1 | |
export VERSION_PCRE=pcre-8.42 | |
#export NPS_VERSION=1.9.32.10 | |
#export VERSION_PAGESPEED=v${NPS_VERSION}-beta | |
$ vagrant up
Bringing machine 'default' up with 'virtualbox' provider...
==> default: Checking if box 'ubuntu/trusty64' is up to date...
==> default: Clearing any previously set forwarded ports...
There was an error while executing `VBoxManage`, a CLI used by Vagrant
for controlling VirtualBox. The command and stderr is shown below.
This is my response to an email asking about Domain-Driven Design in golang project.
Thank you for getting in touch. Below you will find my thoughts on how golang works with DDD, changing it. This is merely a perception of how things worked out for us in a single project.
That project has a relatively well-known domain. My colleagues on this project are very knowledgeable, thoughtful and invested in quality design. The story spelled out below is a result of countless hours spent discussing and refining the approach.
Conclusions could be very different, if there was a different project, team or a story-teller.
import Data.List (groupBy, sortBy) | |
getQuantity xs = let countQuantity acc (_, "registered") = succ acc | |
countQuantity acc (_, "sold") = pred acc | |
compareASC (i1, _) (i2, _) | |
| i1 < i2 = LT | |
| i1 > i2 = GT | |
| i1 == i2 = EQ | |
in map (foldl (countQuantity) 0) $ groupBy (\x y -> (fst x) == (fst y)) $ sortBy (compareASC) xs | |