Skip to content

Instantly share code, notes, and snippets.

View ciscorucinski's full-sized avatar

Christopher Rucinski ciscorucinski

View GitHub Profile
@brainysmurf
brainysmurf / README.md
Last active September 18, 2023 05:31
An `onEdit` trigger that ensures that only one checkbox is selected in a row. Set up once and will work even with changes to name of the sheet, or where it is in terms of rows and columns. Motivated from https://www.benlcollins.com/apps-script/radio-buttons-in-google-sheets/

This onEdit trigger implements the feature as given by Ben Collins.

I was motivated to see if the pattern as given by Ben could be abstracted away so that changes to the sheet name, or changes to the area of the checkboxes changed, and the onEdit trigger wouldn't need to be modified.

Sheet1 tab:

For example, clicking on D1 should change it to checked (X), and uncheck B1.

| | A | B | C | D | E |

@tanaikech
tanaikech / submit.md
Last active July 26, 2023 17:00
Benchmark: Loop for Array Processing using Google Apps Script without V8

Benchmark: Loop for Array Processing using Google Apps Script without V8

April 16, 2018 Published.

July 26, 2018 Updated. Result of reduce was added.

@heinrichreimer
heinrichreimer / ListAdapter.java
Last active March 17, 2016 21:31
A RecyclerView.Adapter which can be used as a List and notifies the RecyclerView of every changes to the contained data.
package com.heinrichreimersoftware.playstorewatcher.adapters;
import android.support.annotation.NonNull;
import android.support.v7.widget.RecyclerView;
import java.io.IOException;
import java.io.InvalidObjectException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.io.Serializable;
/**
* 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();
@mhawksey
mhawksey / gist:1170597
Created August 25, 2011 13:02
Google Apps Script to fill in a Document template with Spreadsheet data
function onOpen() {
var menuEntries = [ {name: "Create Diary Doc from Sheet", functionName: "createDocFromSheet"}];
var ss = SpreadsheetApp.getActiveSpreadsheet();
ss.addMenu("Fitness Diaries", menuEntries);
}
function createDocFromSheet(){
var templateid = "1O4afl8SZmMxMFpAiN16VZIddJDaFdeRBbFyBtJvepwM"; // get template file id
var FOLDER_NAME = "Fitness Diaries"; // folder name of where to put completed diaries
// get the data from an individual user