Engineering

Slacking your Lolcommits and Saving them to Google Drive

Posted April 1, 2015
By Nick Hatt

 

This one is just for fun to close out the week.

Lolcommits takes a snapshot with your webcam every time you git commit code, and archives a lolcat style image with it. Follow the steps below to integrate it with Slack:

  • Install lolcommits
  • Modify your git config (in .git/hooks/post-commit) This is what mine looks like:
#!/bin/sh
### lolcommits hook (begin) ###
export LANG="en_US.UTF-8"  
export PATH="/usr/bin:/usr/local/bin:$PATH"  
export LOLCOMMITS_DIR=###TODO: Your Google Drive Directory###  
lolcommits --capture --delay=3  
###  lolcommits hook (end)  ###
cd "$LOLCOMMITS_DIR"  
cd RedoxEngine ###TODO: Switch to the directory for your project###  
NEWEST=$(ls -t | head -n1)  
curl -F file=@NEWEST -F channels=C024BE91L -F token=xxxx-xxxxxxxxx-xxxx https://slack.com/api/files.upload  
###TODO: Add your slack API key and Channel ID###

Oh, and if you want to hang out, feel free to join our slack.