Skip to content

Instantly share code, notes, and snippets.

@CarlRevell
Created December 30, 2013 16:29
Show Gist options
  • Save CarlRevell/8184316 to your computer and use it in GitHub Desktop.
Save CarlRevell/8184316 to your computer and use it in GitHub Desktop.
Handy-dandy, simple ratio calculator bookmarklet.
javascript:var n = prompt("width?"); var d = prompt("height?"); gcd = function(a, b){if (b === 0) return a; return gcd(b, a % b);}; var div = gcd(+n, +d); alert(n/div + ":" + d/div);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment