Skip to content

Instantly share code, notes, and snippets.

@nikolajbaer
nikolajbaer / gist:778800
Created January 13, 2011 23:03
Litttle jquery js script to create subtotals and totals for columns in a table. Essentially tag the col "td"s that you want to sum with the class sum, mark the col "td"s that you want to be subtotals with the class "subtotal", and mark the total row as cl
<html><head>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
<script type="text/javascript">
$(function(){
function tally (selector) {
$(selector).each(function () {
var total = 0,
column = $(this).siblings(selector).andSelf().index(this);
$(this).parents().prevUntil(':has(' + selector + ')').each(function () {
@nikolajbaer
nikolajbaer / gist:193847
Created September 25, 2009 21:08
San Diego Surf Report script for Android Scripting
"""Display the (scraped) surf report for San Diego from the noaa in a notification."""
__author__ = 'Nikolaj Baer <[email protected]>'
__copyright__ = 'Copyright (c) 2009'
__license__ = 'MIT License'
import urllib,re
LOCATION="San Diego"
AREA="SGX"
REPORT_URL="http://newweb.wrh.noaa.gov/sgx/print_version.php?sid=%s&pil=SRF&version=0"%AREA