Organizational Patterns for Life


This is the most obvious way to organize things. Put them in order based on their name. Good for organizing spices or other items with many members.


Organizing things in the order that they happened in the time-space continuum. Used for event-based organization like ledgers and logs.


This could also be described as ontological. An example of contextual organization would be the Dewey Decimal System at the library where books are organized by theme and topic.


This is organizing things by physical distance. A good example of proximal organization is keys on a keyring. Standing outside the front door, the keys are ordered based their lock’s distance from your eyes. Probably the top deadbolt is first, followed by the doorknob lock. Maybe there is a safety lock box in your house; that key is next. Your car key, since the car is further away in the driveway or parked on the street. Followed by the key to a storage space a mile away and then keys for your day-job across town. Etc.

This also works well for wiring switches. Wire the left-most switch to the closest output and the right-most switch to the furthest output.

Colored Console Output

const out = {

  reset: '\x1b[0m',

  // Modifiers.
  blink: '\x1b[5m',
  bright: '\x1b[1m',
  dim: '\x1b[2m',
  hidden: '\x1b[8m',
  reverse: '\x1b[7m',
  underscore: '\x1b[4m',

  // Foreground Colors.
  black: '\x1b[30m',
  blue: '\x1b[34m',
  cyan: '\x1b[36m',
  green: '\x1b[32m',
  magenta: '\x1b[35m',
  red: '\x1b[31m',
  yellow: '\x1b[33m',
  white: '\x1b[37m',

  // Background Colors.
  bgBlack: '\x1b[40m',
  bgBlue: '\x1b[44m',
  bgCyan: '\x1b[46m',
  bgGreen: '\x1b[42m',
  bgMagenta: '\x1b[45m',
  bgRed: '\x1b[41m',
  bgYellow: '\x1b[43m',
  bgWhite: '\x1b[47m',


console.log(, 'Something went wrong:', err, out.reset);

Validate the Crickets’ Nest

I have a problem getting values from deeply nested objects: if one of the properties along the namespace is incorrect|modified|removed, Javascript throws. To avoid this, you can end up with obnoxious validation:

// Trying to get
const isValid = (
  typeof === 'object' &&
  typeof === 'object' &&
  typeof === 'object' &&
  typeof === 'string'
if (isValid) {
  const { name } =;

What if I made a reusable helper to validate the namespace and return the value?

export default function getNamespace(startObj, path) {
  const isValidArgs = (
    typeof startObj === 'object' &&
    typeof path === 'string'
  if (!isValidArgs) return undefined;

  const finalValue = path
    .reduce((obj, p) => ((typeof obj === 'object') 
      ? obj[p]
      : undefined
    ), startObj);{

  return finalValue;

Now the obnoxious validation looks like this:

// Trying to get
const name = getNamespace(this, '');
if (name) { ... }

Dude! Sweet!

Alias for Git sanity

Git command line is pretty confusing. Here are some aliases that I found helpful that normalize it with other command line commands and add a little bit better context:

$ git config --global checkout
$ git config --global branch
$ git config --global alias.delete-merged !git branch --merged | egrep -v "(^\*|master|development)" | xargs git branch -d
$ git config --global alias.stage add
$ git config --global alias.unstage reset HEAD


Here they are for not forgetting: