Skip to content

Instantly share code, notes, and snippets.

@mootari
mootari / git-match-patch
Last active August 29, 2015 14:17
Attempts to find the commit a patch applies to cleanly. Usage: git-match-patch {branch} {patch-file}
#!/bin/bash
current=$(git rev-parse HEAD)
commits=$(git rev-list $1)
for rev in $commits; do
git checkout --quiet $rev
git apply --check $2 2>/dev/null
if [ $? == 0 ]; then
git log -n 1
exit 0
fi
@cvrebert
cvrebert / css_regression_testing.md
Last active May 28, 2024 17:42
Survey of screenshot-based CSS testing tools

Currently considering https://github.com/webdriverio/webdrivercss


Core Goals:

  • Can test in up-to-date versions of all major browsers
  • Can test on up-to-date versions of all major OSes
  • Can test in IE9 (because Bootstrap v4 will support IE9+)
  • Don't want to have to setup/maintain our own cluster of VMs running all the necessary OSes (and all the versions of Windows)
  • Workflow for management of reference/baseline/norm screenshots
@tracker1
tracker1 / 01-directory-structure.md
Last active May 26, 2024 13:59
Anatomy of a JavaScript/Node project.

Directory structure for JavaScript/Node Projects

While the following structure is not an absolute requirement or enforced by the tools, it is a recommendation based on what the JavaScript and in particular Node community at large have been following by convention.

Beyond a suggested structure, no tooling recommendations, or sub-module structure is outlined here.

Directories

  • lib/ is intended for code that can run as-is
  • src/ is intended for code that needs to be manipulated before it can be used
#!/bin/bash
# We need the TAB character for SED (Mac OS X sed does not understand \t)
TAB="$(printf '\t')"
function abort {
echo "$(tput setaf 1)$1$(tput sgr0)"
exit 1
}