

Cool hack to take a photo of yourself on every commit - bitsweet
http://coderwall.com/p/xlatfq?i=9&p=1&q=

======
praptak
A similar article from 2009: a guy takes photo of his face on every failed
merge. [http://andialbrecht.wordpress.com/2009/05/09/when-merging-
fa...](http://andialbrecht.wordpress.com/2009/05/09/when-merging-fails/)

------
ken
Earlier, jwz in 1994:

"There's finally an Indy on my desk instead of a Sun4. This means that I also
have an IndyCam, so I hacked up a script to grab and save a frame of me
sitting there every five minutes."
(<http://www.jwz.org/gruntle/nscpdorm.html>)

~~~
thwarted
I tried doing timed snapshots, but it frequently caught an empty chair. So I
have it take a picture whenever I deactivate the screen saver, so I'm pretty
much guaranteed to be in front of the machine. I also have hooks for other
activities/events, like while I'm playing QuakeLive.

<https://github.com/thwarted/picsofourlives>

------
protomyth
I just have this sick worry that some company will do something like this and
use it as part of the code review.

"You don't look confident in the picture, is there some reason for that?"

~~~
frossie
On the flip side, you will now have documentary evidence to support the
assertion "that bug gave me grey hair!"

~~~
protomyth
Ok, sorta tangent on this. It would be a very interesting study to take photos
of a large sampling of drivers during a morning commute into a city. I wonder
if you could get some information on what parts of the road really stress out
the drivers and cause those grey hairs?

------
dubajj
also done by lolcommits quite a while ago:
<https://github.com/mroth/lolcommits>

~~~
jordo37
Plus lolcommits includes the commit message. Great for when some of our less
technical folks work on the UI and regularly submit "SDF" as the commit
message...

------
dag11
Nice. I like this idea.

Would there be any straightforward ways to pull this off with Git on my
Windows machine?

~~~
prydonius
Try lolcommits: [https://github.com/mroth/lolcommits/wiki/Installing-on-
Windo...](https://github.com/mroth/lolcommits/wiki/Installing-on-Windows)

------
mahmud
I have heard of duck-typing but not duckface-typing.

------
jdub
Why do people write five lines of inefficient Ruby when a more direct single
line shell script would suffice?

~~~
batista
Because the "inefficiency" is negligible and "premature optimization" is the
root of all evil.

Because the time it would take them to check the arcane shell syntax would
dwarf the time it takes for them to throw a Ruby script together.

Because they like using a superior programming language over the cruft that
are the shell syntaxes.

Because they can add more fancy stuff and features to the Ruby version far
more easily.

Because they can incorporate the Ruby version to a larger program later on.

~~~
quarterto
Because

    
    
        file="~/.gitshots/$(date).jpg"
        echo "Taking capture into ${file}!"
        imagesnap -q -w 3 $file

is _so_ arcane.

~~~
batista
No, the options when you need to add something more are arcane.

Plus the above wont even work as is, since $(date) contains spaces.

~~~
adobriyan
> Plus the above wont even work as is, since $(date) contains spaces.

This would be "more direct" part.

------
noonespecial
That should provide some entertainment later on. I look pretty ragged
sometimes when I finally stumble across the line and commit something I've
been at war with.

------
stephth
How about an animation instead?

    
    
        #!/usr/bin/env ruby
        num_snaps = 5
        time_int = Time.now.to_i
        num_snaps.times do |i|
          file="~/.gitshots/#{time_int}__#{i+1}_of_#{num_snaps}.jpg"
          system "imagesnap -q #{file}"  
        end
        exit 0
    

The problem with this code is it makes the camera go on and off successively,
which creates a minimum delay between shots. It would be nicer to have finer
control over the interval.

Picturesnap somehow supports sequences but there's no control to how long they
should last (would require firing a background task), and snapshots get saved
in the running directory (instead of based on the passed filename/path) which
would require mving each file. Pull request could be a short and sweet free
time project...

~~~
badboy
Just change the current working directory in the script before running the
task. No need to move them then.

~~~
stephth
You're quite right. But we're still left with many problems stemmed from not
having control on the sequence length and file names. I've tried it with a
background task and the results are super flimsy. The time that the camera
takes to be ready varies which then makes the number of files generated vary,
sometimes the process is killed before imagesnap finished saving current file
resulting in a corrupted image. And the file names outputted are really
begging for some post-processing renaming.

Here's what I have for what it's worth:

    
    
        #!/usr/bin/env ruby
        require 'rubygems'
        require 'systemu'
        Dir.chdir(File.expand_path('~/.gitshots'))
        cam_warm_up_time = 2
        num_snaps = 6
        interval = 0.2
        systemu "imagesnap -w #{cam_warm_up_time} -t #{interval}" do |cid|
          sleep cam_warm_up_time + interval * num_snaps
          Process.kill 9, cid
          exit 0
        end

------
wanderingstan
This little hack takes a picture every hour (webcam and screenshot) and gives
visualization of your online work habits: <http://wanderingstan.com/lifeslice>

------
fidz
First time i think, "what is it used for?" Then i think, "it gonna be fun!"
Then i think this hack could inspire me to do something cool for git.

Are there any more "unusual" git hack?

~~~
alttab
We have post-commit hooks into a web application that will play unreal
tournament WAVs on a PA depending on how many commits you have made.

Rampage!

~~~
fizx
Github link?!

~~~
alttab
<https://github.com/skottie/rawr-box>

Not really designed for public consumption, and the code is quick and dirty.
Designed to run on a Mac.

Can also be used with speech recognition and applescripts to curl the web
server for voice commands.

------
adventureloop
I had a script that took a picture of my every half hour. This ran for about
six months and gave me a brilliant insight into the ins and outs of my laptop
usage.

------
datn
Under Linux, one could easily substitute fswebcam
<https://github.com/fsphil/fswebcam> for command-line pictures and avconv
<http://www.itforeveryone.co.uk/image-to-video.html> to make the timelapse.

<http://coderwall.com/p/ijgggw>

------
tomhenderson
I do something similar now and then with a script that takes a photo and a
screen grab every minute throughout the day. The resulting 1-2 min movies can
be quite fascinating to watch (for me at least).

------
tubbo
that is...completely ridiculous.

------
npaquin
Oh.

------
nonameisfinetoo
Just how narcissistic can you get?

------
chris123
Bro (i.e, this idea sounds like a Brogrammer thing to me).

~~~
Tichy
So what do we call programmers who are too cool to be Brogrammers?

~~~
Killswitch
PROgrammers.

I'll just leave now.

------
jen_h
I know this makes me a terrible person and I feel bad about what my brain is
saying because someone went to the effort to create this and it's kind of cool
if you're the kind of person who isn't creeped out by their own pictures, but
my brain instinctually just keeps repeating, "Dang, that's coquetastic!"

