Skip to content

Instantly share code, notes, and snippets.

@distrill
distrill / cowboy_trx.js
Last active November 6, 2019 22:24
transactional route connections, but no transaction wrangling anywhere in the business logic
const express = require('express');
const knex = require('knex')({
client: 'pg',
connection: {
user: 'dev',
password: 'dev',
database: 'dev',
},
});
// CryptoAnimal - interface we're extending with concrete instances and decorators
class CryptoAnimal {
// each animal has some sort of history that makes them who they are today
background() {
throw new Error('implement me pls');
}
// all of the things in that history make them less common
rarity() {
throw new Error('implement me pls');
#!/bin/bash
file="./container/docker-compose.yml"
project="whatever"
case $1 in
"up")
echo "setting up containers in background"
docker-compose -f $file -p $project up -d
;;