Skip to content

Instantly share code, notes, and snippets.

View shali3's full-sized avatar

ShaLi Shaltiel shali3

View GitHub Profile
@shali3
shali3 / HRcal.js
Last active January 21, 2016 09:24
Calculates calories from heart rate in RunKeeper
// You can use this code snippet on runkeeper edit activity page to calculate clories according to your heartrate.
// This is very useful when you're tacking indoor (stopwatch) activities that only track heart rate and time.
// To run this you can add a bookmark to you browser with the following line instead of an address:
// javascript:$.get('https://gist.githubusercontent.com/shali3/4c38cd2b355ebc9d1749/raw',eval)
// Please fork this gist and and adjust the parametes here.
// Formula source: http://www.shapesense.com/fitness-exercise/calculators/heart-rate-based-calorie-burn-calculator.aspx
var hr=parseInt($('#avgHeartRate').val()),
kg=70, // Add your weight here (in Kg).