Skip to content

Instantly share code, notes, and snippets.

View andrewroberts's full-sized avatar
Cranking out the code... 👨‍💻

Andrew Roberts andrewroberts

Cranking out the code... 👨‍💻
View GitHub Profile
brainysmurf /
Last active April 3, 2024 18:17
Things one can get used to for the V8 Google Apps Scripts engine

Things one can get used to for the V8 Google Apps Scripts engine

A bit of a monologue about various syntax changes and adjustments in learning and using the tool.

Logging is slooooooow

I know. Everyone knows.

That's why I wrote a library that writes to a spreadsheet instead. Ever since I started using it I'm far more productive. I don't know how people are still putting with that god-awful lagging logger.

brainysmurf / PackageManager.js
Last active September 24, 2023 12:17
Package Manager: Manage libraries in apps script, establish convention for including packages, optionally use TDD.
* PackageManager © Adam Morris
* A toolchain solution for test-driven development and package management
* What it does:
* - Provides boilerplate code to make modular packages publishable as gists
* - Define and adds all those dependencies to the project so that there are completely modular
* - Access them in your own code with "pgk.namespace" where the namespace is defined in the dependency setup file
* - Test the modules with TDD practices!
* To use:
* - Make a copy:
Spencer-Easton /
Last active March 21, 2024 00:43
Example on how to export a Google sheet to various formats, includes most PDF options
function exportSpreadsheet() {
//All requests must include id in the path and a format parameter
//format=xlsx //excel
//format=ods //Open Document Spreadsheet
//format=zip //html zipped
azadisaryev / convertExcel2Sheets
Last active March 9, 2024 18:23
Google Apps Script for converting Excel (.xls or .xlsx) file to Google Spreadsheet. Drive API must be enabled in your script's Advanced Google Services and in Developers Console for the script to work (see for details).
* Convert Excel file to Sheets
* @param {Blob} excelFile The Excel file blob data; Required
* @param {String} filename File name on uploading drive; Required
* @param {Array} arrParents Array of folder ids to put converted file in; Optional, will default to Drive root folder
* @return {Spreadsheet} Converted Google Spreadsheet instance
function convertExcel2Sheets(excelFile, filename, arrParents) {
var parents = arrParents || []; // check if optional arrParents argument was provided, default to empty array if not
patt0 / cbl.js
Last active March 7, 2024 20:12
ContinuousBatchLibrary is a Google Apps Script library that manages large batches and works around the 5 minute limitation of GAS execution. It does this by setting time based triggers in the future as well as memorising the last processed key in the batch in order to restart from the correct position. At the end of the batch a cleanup function …
* --- Continous Execution Library ---
* Copyright (c) 2013 Patrick Martinent
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
malarkey / Contract Killer
Last active May 24, 2024 23:38
The latest version of my ‘killer contract’ for web designers and developers

When times get tough and people get nasty, you’ll need more than a killer smile. You’ll need a killer contract.

Used by 1000s of designers and developers Clarify what’s expected on both sides Helps build great relationships between you and your clients Plain and simple, no legal jargon Customisable to suit your business Used on countless web projects since 2008