Skip to content

Instantly share code, notes, and snippets.

@laugri
laugri / Who-The-A-Method-for-Hiring.md
Last active September 21, 2023 07:12
Who: The a Method for Hiring - Geoff Smart and Randy Street - Summary

This is my summary of "The A method for recruiting" by Geoff Smart and Randy Street.

"I feel great ! I have a fantastic team working with me now. [...] It's all because I have a team of A players."

The "A" method for recruiting

  • Make a scorecard for the position
  • Source candidates
  • Select a candidate
  • Sell the job to them
const express = require('express');
const morgan = require('morgan');
const path = require('path');
const PORT = process.env.PORT || 3000;
const app = express();
const logger = morgan(
process.env.NODE_ENV !== 'production' ? 'dev' : 'combined',
#!/bin/sh -e
usage() {
echo "OVERVIEW: Build apps according to BUILD_ENV value. Meant to be used for Heroku deployment"
exit
}
if [ "$1" = '-h' ] || [ "$1" = '--help' ]; then
usage
fi
{
"scripts": {
"heroku-postbuild": "./scripts/heroku.build",
}
}
@laugri
laugri / ddd-example-value-object.js
Last active December 5, 2018 16:59
DDD example - Value Object
// An example of a Value Object
class Price {
amountInEuroCents: number
inEuros(): number {
// implementation
}
@laugri
laugri / ddd-example-entity.js
Created December 2, 2018 17:08
DDD example - Entity
// An example of an Entity
class ShoppingCart {
id: ShoppingCartId;
items: Array<ShoppingCartItem>
addItem(item: ShoppingCartItem) {
// implementation
}
@laugri
laugri / ddd-example-domain-service.js
Created December 2, 2018 17:11
DDD example - domain service
// For e-commerce, an example of a domain service would be the checkout step
function checkout(shoppingCart: ShoppingCart, ...) {
// do service stuff
}
@laugri
laugri / ddd-example-aggregate.js
Created December 2, 2018 17:14
DDD Example - Aggregate.js
// Our ShoppingCart example of an Entity is actually also an aggregate.
class ShoppingCart {
id: ShoppingCartId;
items: Array<ShoppingCartItem>
addItem(item: ShoppingCartItem) {
// implementation
}
@laugri
laugri / ddd-example-repository-interface.js
Created December 2, 2018 17:16
DDD example - Repository Interface
// Repository interface example
interface ShoppingCartRepository {
findById(shoppingCartId: ShoppingCartId): Promise<ShoppingCart>;
store(shoppingCart: ShoppingCart): Promise<void>;
}
@laugri
laugri / ddd-example-repository-implementation.js
Created December 2, 2018 17:16
DDD example - Repository implementation
// Repository implementation example
class InMemoryShoppingCartRepository implements ShoppingCartRepository {
findById(shoppingCartId: ShoppingCartId) {
// implementation
}
store(ShoppingCart: ShoppingCart): Promise<void> {
// implementation