GitFit - A pre-commit hook using the Fitbit API
What it does
Prevents you from committing code unless you've met your primary Fitbit goal for the day.
After coming home from work, I eat dinner in front of my TV and frequently code all night. This is quite unhealthy. To limit my all-nighters, I need to enforce some restrictions on myself. Now, in order to commit code I must first meet one of my Fitbit goals (10,000 steps, 5 miles, or being very active for 30 minutes). If I miss my goal the commit is rejected -- which also means I can't deploy.
Areas for improvement: right now, even if I hit my goal, I can't code after midnight. Then again, that may not be such a bad thing.
- Install the Python Fitbit API wrapper
pip install fitbit
- Make sure hook is executable
chmod u+x pre-commit& saved to your hooks folder (global or repo level)
- Create a new Fitbit app & note down your API keys
- Get your userid by visiting your profile online & noting down the string that comes after
https://www.fitbit.com/user/(mine is 2SZVTN)
- Make sure your Activities are public here: https://www.fitbit.com/user/profile/privacy
- Try committing something