Skip to content

Instantly share code, notes, and snippets.

View Marknel's full-sized avatar

Mark Cracknell Marknel

View GitHub Profile
@Marknel
Marknel / gist:40d5c9bf9f014e7a234a
Last active January 25, 2019 19:15
Calorie Calculator
// Inputs
var sex = "male" // "male" || "female"
var age = 24 // Age in years
var height = 172 // Height in centimeters
var weight = 75 // Weight in kilograms
var activity_scalar = 1.2 // 1 -> 1.9 (1 being motionless, 1.9 being hugely active)
calculateBMR = function(sex, age, weight, height) {
var bMR = 0;
@Marknel
Marknel / gist:b1c2ddc3b02f73d0a73d
Created May 21, 2015 23:51
3rd Grade Maths Problem Solver (Brute Force)
var processor2 = function(v) {
return ((13*v[1])/v[2])+v[0]+v[3]+12*v[4]-v[5] + ((v[6]*v[7])/v[8]) == 87;
}
var start_time = Date.now(),
total_combinations = 0,
pv = [1,2,3,4,5,6,7,8,9],
permArr = [],
usedChars = [];