Skip to content

Instantly share code, notes, and snippets.

/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();
@halfbaked
halfbaked / fakeSinonServer.js
Created May 12, 2011 12:38
using sinon.js to fake json response from server
server = sinon.fakeServer.create()
server.autoRespond=true
server.respondWith("GET", /\/customer\/(\d+)/, (xhr, id) ->
xhr.respond( 200, { "Content-Type": "application/json" }, JSON.stringify(window.sampleCustomerJson ))
)