Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Cool hack to take a photo of yourself on every commit (coderwall.com)
153 points by bitsweet on June 23, 2012 | hide | past | favorite | 39 comments


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...


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)


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


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?"


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


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?


also done by lolcommits quite a while ago: https://github.com/mroth/lolcommits


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...


This project is eerily identical to lolcommits


Nice. I like this idea.

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



Looks like this would work as a native alternative: http://batchloaf.wordpress.com/commandcam/


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


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


Because they're used to using Ruby. The efficiency difference is negligible.

$ time sh -c exit

real 0m0.002s

user 0m0.001s

sys 0m0.000s

$ time ruby -e exit

real 0m0.009s

user 0m0.008s

sys 0m0.000s

OTOH I do agree that it is a bit silly to start a Ruby interpreter if you're only going to use it to shell out :)


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.


Because

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


Even better (the silence principle):

    #!/bin/sh
    imagesnap -q -w 3 "~/.gitshots/$(date).jpg"
(date(1) with spaces will be fine due to the double quotes, although it won't be in date order when sorted by name, which would annoy me...)


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

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


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

This would be "more direct" part.


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.


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...


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


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


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


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?


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!


Github link?!


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.


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.


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


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).


that is...completely ridiculous.


Oh.


Just how narcissistic can you get?


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


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


PROgrammers.

I'll just leave now.


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!"




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: