no-commit pre-commit

Copy to .git/hooks/pre-commit:


if git rev-parse --verify HEAD >/dev/null 2>&1; then  
  # Initial commit: diff against an empty tree object

exec 1>&2

for FILE in `git diff-index --cached --name-status $against -- | cut -c3-`; do  
  if grep -q 'NOCOMMIT' "$FILE"; then
    echo $FILE 'contains NOCOMMIT!'
    exit 1

exit 0  

The hook will prevent any file containing the text NOCOMMIT from being committed.

How to enable a global pre-commit hook.

test targets and CocoaPods

For my future reference...

  1. Make sure the Podfile link_with value is only the app target, not the tests target.

  2. In the tests target build settings, add "Pods/Public/Headers" as a recursive search path.

If you link_with the tests target, two bad things will happen:

  1. CocoaPods will add a Link Binary With Libraries build phase to the tests target, but the pods are already statically linked with the app target.

  2. CocoaPods will add to the Debug and Release configurations for the tests target, which will add an OTHER_LDFLAGS setting for all of the individual libraries, but the pods are already statically linked with the app target.

you know nothing of my work

This scene really needs a Roy Fielding overdub.

Donald Norman on watches

– The Design of Everyday Things (1988)

– The Invisible Computer (1998)


It's much more convenient to prepareForSegue where you performSegue.

typedef void (^PrepareForSegueBlock)(UIStoryboardSegue *);  


- (void)viewThatThing:(Thing *)aThing {
  [self performSegueWithIdentifier:@"Thing" sender:^(UIStoryboardSegue *segue) {
    ThingViewController *thingViewController = (id)segue.destinationViewController;
    thingViewController.theThing = aThing;
    thingViewController.delegate = self;


- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {