This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as coda from "@codahq/packs-sdk"; | |
export const pack = coda.newPack(); | |
const ClientId = "..."; | |
const ClientSecret = "..."; | |
pack.addNetworkDomain("zendesk.com"); | |
pack.setUserAuthentication({ | |
type: coda.AuthenticationType.Custom, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import * as coda from "@codahq/packs-sdk"; | |
export const pack = coda.newPack(); | |
// TODO: Set domain and API key. | |
const ProjectDomain = "<subdomain>.supabase.co"; | |
const ApiKey = <apikey>"; | |
const ProjectUrl = `https://${ProjectDomain}`; | |
pack.addNetworkDomain(ProjectDomain); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Copyright 2019 Google LLC. | |
* SPDX-License-Identifier: Apache-2.0 | |
*/ | |
var CHECKBOX_COLUMN = 'B'; | |
function onEdit() { | |
var range = SpreadsheetApp.getActiveRange(); | |
if (range.getA1Notation().split(/\d/)[0] == CHECKBOX_COLUMN && |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @license | |
* Copyright 2019 Google LLC | |
* | |
* 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 | |
* | |
* https://www.apache.org/licenses/LICENSE-2.0 | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Move events with a given title from your primary calendar to another calendar. | |
* You must enable the Calendar Advanced Service: | |
* https://developers.google.com/apps-script/guides/services/advanced#enabling_advanced_services | |
*/ | |
function moveEvents(eventTitle, fromCalendarName, toCalendarName) { | |
var fromCalendarId = CalendarApp.getCalendarsByName(fromCalendarName)[0].getId(); | |
var toCalendarId = CalendarApp.getCalendarsByName(toCalendarName)[0].getId(); | |
var now = new Date(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function downloadFileRange(fileId, startByte, endByte) { | |
// Mention DriveApp in a comment to ensure the Drive scope is requested. | |
// DriveApp.getRootFolder(); | |
var url = 'https://www.googleapis.com/drive/v3/files/' + | |
fileId + '?alt=media'; | |
var response = UrlFetchApp.fetch(url, { | |
headers: { | |
Authorization: 'Bearer ' + ScriptApp.getOAuthToken(), | |
Range: 'bytes=' + startByte + '-' + endByte | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function onOpen() { | |
DocumentApp.getUi().createMenu('Demo') | |
.addItem('Select Spreadsheet', 'selectSpreadsheet') | |
.addItem('Update Data', 'updateData') | |
.addToUi(); | |
} | |
function selectSpreadsheet() { | |
var result = DocumentApp.getUi().prompt('Enter the ID of the spreadsheet:'); | |
var spreadsheetId = result.getResponseText(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Gets all the unmerged ranges within a range. | |
* @param {SpreadsheetApp.Range} range The range to evaluate. | |
* @returns {SpreadsheetApp.Range[]} The unmerged ranges. | |
*/ | |
function getUnmergedRanges(range) { | |
if (!range.isPartOfMerge()) { | |
return [range]; | |
} | |
var mergedRanges = range.getMergedRanges(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>GAM Sample App</title> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/URI.js/1.17.1/URI.js"></script> | |
<script src="https://apis.google.com/js/platform.js?onload=init" async defer></script> | |
</head> | |
<body> | |
<h1>GAM Sample App</h1> | |
<p id="message">Loading...</p> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Setup: Spreadsheet in Pacific time, Script in Eastern time, Calendar in Mountain time. | |
// Sample spreadsheet: https://docs.google.com/spreadsheets/d/1neePK1YPKMKnVwI8dld0HSJjI1kSFPpcY8g7kG8xG4U/edit#gid=0 | |
// A2 = 3/1/2016 9:00 AM, B2 = 3/1/2016 10:00 AM | |
/** | |
* The dates and times in the spreadsheet refer to exact moments in time, and the clock | |
* on the wall may show a different time. | |
*/ | |
function copyMoment() { | |
var ss = SpreadsheetApp.getActive(); |
NewerOlder