Skip to content

Instantly share code, notes, and snippets.

View vkotek's full-sized avatar

Vojtech Kotek vkotek

View GitHub Profile
@vkotek
vkotek / Code.gs
Last active April 21, 2018 09:25 — forked from primaryobjects/Code.gs
Export a Google Drive spreadsheet to PDF in Google Drive in the same folder.
// Simple function to add a menu option to the spreadsheet "Export", for saving a PDF of the spreadsheet directly to Google Drive.
// The exported file will be named: SheetName and saved in the same folder as the spreadsheet.
// To change the filename, just set pdfName inside generatePdf() to something else.
// Running this, sends the currently open sheet, as a PDF attachment
function onOpen() {
var submenu = [{name:"Save PDF", functionName:"generatePdf"}];
SpreadsheetApp.getActiveSpreadsheet().addMenu('Export', submenu);
}
import itertools
# set test vars
yy = "1993"
mm = "05"
dd = "19"
# convert yyyy to yy
if len(str(yy)) == 4:
yy = yy[2:]