Geeking Out

Git Hooks

In a team development environment it usually becomes necessary to put some sanity checks in place because multiple people are contributing code. A Git pre-commit hook can go a long way to help keep things clean and orderly. I've developed a pre-commit hook that looks at the staged files and:

  • Runs unit tests
  • Runs the PHP linter
  • Runs the PHP Code Sniffer
  • Runs the PHP Code Sniffer Fixer if it finds fixable errors
  • Runs the PHP Compatibility check against the specified version

See my GitHub repo for the code.

Git Automation

If you use Git a lot and find yourself doing the same things over an over, then a script can help save time and typing. Feel free to copy/paste my code to automate certain repetitive tasks like managing stashes and committing and merging. I prefix my Git commands with 'gt' and then some kind of shorthand for a command.

See my GitHub repo for the code.

Web Stuff

A cross-platform way to avoid phone numbers, email addresses, dates, etc from displaying as links:

Break up the pattern with <span> tags.

raw numbers: 123-456-7890
mark up: <span>1</span>2<span>3-</span>45<span>6-7</span>8<span>90</span>
rendered: 123-456-7890

Of course, you can also use the iOS specific way of using a <meta> tag:

<meta name="format-detection" content="telephone=no"> :: web :: geeking out