Skip to content

Instantly share code, notes, and snippets.

@corlaez
corlaez / README.md
Last active April 11, 2024 07:47
Hexagonal Architecture and Modular Implementation

Hexagonal Architecture

Conceptualized by Alistair Cockburn. Also known as "Ports and Adapters".

In a nutshell:

Application Driver -> Primary Adapter -> Primary Port -> Use Case -> Secondary Port -> Secondary Adapter -> External System/Side Effect
@tlrobinson
tlrobinson / post-receive
Last active December 7, 2022 08:15
Super simple git post-receive hook for Node.js + nvm + npm + node-foreman + init (Ubuntu) deployment
#!/usr/bin/env bash
set -u
set -e
export GIT_WORK_TREE="/var/www/example.com"
export NODE_VERSION="0.10"
echo "--> Checking out..."
git checkout -f
@vermilion1
vermilion1 / gist:5525972
Last active December 17, 2015 01:09
Override Marionette route to have ability to pass different controllers to the single router
Marionette.AppRouter.prototype.processAppRoutes = function(controller, appRoutes) {
var routeNames = _.keys(appRoutes).reverse(); // Backbone requires reverted order of routes
_.each(routeNames, function(route) {
var methodName = appRoutes[route];
var params = methodName.split('#');
var ctrl = controller;
var method;
if (params.length > 1) {