Skip to content

Instantly share code, notes, and snippets.

@arbovm
Created August 18, 2010 13:21
Show Gist options
  • Save arbovm/534707 to your computer and use it in GitHub Desktop.
Save arbovm/534707 to your computer and use it in GitHub Desktop.
function(head, req) {
var row
var rows=[]
while(row = getRow()) {
rows.push(row)
}
rows.sort(function(a,b) {
return b.value-a.value
})
send(JSON.stringify({"rows" : rows}))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment