Skip to content

Instantly share code, notes, and snippets.

View gsheppard's full-sized avatar

Gregory Sheppard gsheppard

View GitHub Profile
@quantizor
quantizor / gist:fb49faa066c837518af0
Created June 25, 2014 01:54
Mortgage Loan Qualification Equation
Total qualified mortgage amount = ( 0.5 - c(m/(1-(1+m)^-n)) - T(c) - I(c) + R((A-d*12)/12) ) / ( m/(1-(1+m)^-n) + T + I )
A = gross annual income
I = decimal insurance rate
R = decimal maximum allowed payment/income ratio based on creditworthiness (44% -> 0.44, etc.)
T = decimal tax rate / 12
c = down payment
d = gross monthly debt
i = decimal interest rate
anonymous
anonymous / gist:10295917
Created April 9, 2014 17:41
Example of a jQuery form submission
$('form').on('submit', function(e){
// Keeps the form from refreshing the page
e.preventDefault();
// Cached reference to the form (the less lookups the better)
var self = $(this);
// Combs through the form and converts all the inputs into serialized versions to be
// interpreted by wherever you are sending the data