Skip to content

Instantly share code, notes, and snippets.

@consti
Created July 10, 2012 09:57

Revisions

  1. consti revised this gist Jul 10, 2012. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions post-commit
    Original file line number Diff line number Diff line change
    @@ -15,9 +15,9 @@
    #
    #
    # > brew install imagesnap
    # Save this file as ~/.git_templates/hooks/post-commit
    # Save this file as ~/.git_template/hooks/post-commit
    # then do:
    # > chmod +x ~/.git_templates/hooks/post-commit
    # > chmod +x ~/.git_template/hooks/post-commit
    # > git config --global init.templatedir '~/.git_template'
    #
    # this will add the post-commit to all new repositories.
  2. consti revised this gist Jul 10, 2012. 1 changed file with 12 additions and 0 deletions.
    12 changes: 12 additions & 0 deletions post-commit
    Original file line number Diff line number Diff line change
    @@ -4,6 +4,16 @@
    #
    # Take a photo of you, whenever you make a commit
    #
    # This is an improved version of Víctor Martínez original post:
    # http://coderwall.com/p/xlatfq
    #
    # Improvements:
    # * This is non-blocking (you dont have to wait for your image to be taken)
    # * It's plug-and-play (and creates the required folder)
    # * We include the repository name (or the folder name of the repository to be exact)
    # * It's not requiring ruby to run (it just uses bash)
    #
    #
    # > brew install imagesnap
    # Save this file as ~/.git_templates/hooks/post-commit
    # then do:
    @@ -15,6 +25,8 @@
    # > git init
    # in the repository.
    #
    # Want to create a cool video? Use this to assemble the pictures:
    # http://www.dayofthenewdan.com/projects/tlassemble

    forked_image() {
    mkdir -p ~/.git_shots
  3. consti revised this gist Jul 10, 2012. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion post-commit
    Original file line number Diff line number Diff line change
    @@ -6,7 +6,8 @@
    #
    # > brew install imagesnap
    # Save this file as ~/.git_templates/hooks/post-commit
    # and run
    # then do:
    # > chmod +x ~/.git_templates/hooks/post-commit
    # > git config --global init.templatedir '~/.git_template'
    #
    # this will add the post-commit to all new repositories.
  4. consti created this gist Jul 10, 2012.
    23 changes: 23 additions & 0 deletions post-commit
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    #!/bin/sh


    #
    # Take a photo of you, whenever you make a commit
    #
    # > brew install imagesnap
    # Save this file as ~/.git_templates/hooks/post-commit
    # and run
    # > git config --global init.templatedir '~/.git_template'
    #
    # this will add the post-commit to all new repositories.
    # To add to an existing one, run
    # > git init
    # in the repository.
    #

    forked_image() {
    mkdir -p ~/.git_shots
    imagesnap -q -w 3 ~/.git_shots/$(date +%s)_$(basename $PWD).jpg &
    }

    forked_image &