Skip to content

Instantly share code, notes, and snippets.

View joelove's full-sized avatar

Joe Love joelove

View GitHub Profile
@joelove
joelove / gnu_osx_install
Last active October 17, 2018 15:14 — forked from tlnagy/gnu_osx_install
This small script uses Homebrew to make your OS X machine more Linux-like by adding the GNU variants of many command line tools to your PATH. You will need Xcode's command line tools and homebrew installed. Also you'll need to quit and re-initialize your shell to see the changes.
#! /bin/sh
# Copyright (c) 2014, Tamas Nagy <tamas at tamasnagy dot com>
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.

Writing tests for validators

I've broken down the validation architecture in to its absolute simplest form so we can use it to understand and compare testing approaches.

The validation architecture

Let's say we have a set of simple validation functions that fail whatever you pass in:

validations.js

@joelove
joelove / form-validators.md
Created July 24, 2018 14:09
Form Validators

Form validators

Form validators are comprised of validation rules. Each of these rules receive:

  • The name of a field or collection to validate
  • A unique, human-readable key to describe the validation
  • A function that validates the field or collection
  • An optional function to validate the entire form data object
  • An optional function to combine the results of the main validation result and the form data validation result
@joelove
joelove / builder-pattern.md
Last active February 22, 2018 16:59
The Builder Pattern in JavaScript

The Builder Pattern in JavaScript

What the hell are Design Patterns?

In this talk I'm going to start from the bottom up. We're going to find out what software design patterns are, and how we use them. Then we're going to focus on one design pattern in particular and analyse why and how you would use it.

What is a Design Pattern?

In software engineering, a design pattern is a general repeatable solution to a commonly occurring problem in software design. It is a description or template for how to solve a problem that can be used in many different situations.

Where do we get all these Design Patterns?

Releases Without Resistance

This is a document explaining a proposed principle for releasing code changes on the Investor Services project. I've named the concept "Releases Without Resistance" (or RWR).

Glossary

The main branch

This is the branch that contains the latest version of the project code. For us that is currently employee-portal, in GitFlow it is usually development.

The obvious stuff

@joelove
joelove / keybase.md
Created March 4, 2015 13:53
Keybase proof

Keybase proof

I hereby claim:

  • I am joelove on github.
  • I am eru (https://keybase.io/eru) on keybase.
  • I have a public key whose fingerprint is 5A27 61E7 C94F 1588 42A5 C9E4 ADE8 9907 35E8 0E62

To claim this, I am signing this object: