Skip to content

Instantly share code, notes, and snippets.

@mleon
mleon / gist:97877
Created April 19, 2009 02:36
counting code
#!/usr/bin/env ruby
require 'yaml'
USAGE = %Q(
Name
lines_of_code.rb
Synopsis
find <find_options> | lines_of_code.rb [--order_by <code|totals|files>] [--reverse_order] [help|--help|-h]
this script expects to be fed a bunch of filenames separated by line feeds
<h2>JQuery Mortgage Calculator</h2>
<script type='text/javascript' src='http://jqueryjs.googlecode.com/files/jquery-1.2.6.min.js'></script>
<!--The following formula is used to calculate the fixed monthly payment (P) required to fully amortize a loan of L dollars over a term of n months at a monthly interest rate of c. [If the quoted rate is 6%, for example, c is .06/12 or .005]. P = L[c(1 + c)^n]/[(1 + c)^n - 1]-->
<h3>Mortgage Calculator Example<br /></h3>
<form>
<p><input id="mcPrice" class="mortgageField" name="mcPrice" type="text" /> Sale price ($)</p>
<p><input id="mcDown" class="mortgageField" name="mcDown" type="text" /> Down payment (%)</p>
<p><input id="mcRate" class="mortgageField" name="mcRate" type="text" /> Interest Rate (%)</p>