
This file contains hidden or 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
| // This is a quick demonstration of "function inheritance" as described in | |
| // this paper from Daniel Brown and William Cook. | |
| // http://www.cs.utexas.edu/users/wcook/Drafts/2009/sblp09-memo-mixins.pdf | |
| // Expressed in TypeScript (and without the monads). | |
| // Syntax note: When you write function types in TypeScript, you need to name | |
| // each parameter. But the names don't actually matter, so I just use _. You | |
| // can read `(_:A) => B` as `a -> b` in ML or Haskell syntax. | |
| // In Brown and Cook's Haskell, `type Gen a = a -> a` is a "generator." The |
This file contains hidden or 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
| /** | |
| * ABOUT | |
| * Google Apps Script to post a message to Slack when someone responds to a Google Form. | |
| * | |
| * Uses Slack incoming webhooks - https://api.slack.com/incoming-webhooks | |
| * and FormsResponse - https://developers.google.com/apps-script/reference/forms/form-response | |
| * | |
| * | |
| * AUTHOR | |
| * Akash A <github.com/akash1810> |
This file contains hidden or 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
| /** | |
| * Returns Mobile Speed & Optimization and Desktop Speed & Optimization values in six adjacent columns | |
| * by Cagri Sarigoz | |
| */ | |
| function checkAll(Url) { | |
| //CHANGE YOUR API KEY WITH YOUR_API_KEY BELOW | |
| var key = "YOUR_API_KEY"; | |
| var serviceUrlMobile = "https://www.googleapis.com/pagespeedonline/v4/runPagespeed?url=" + Url + "&strategy=mobile&key=" + key; | |
| var serviceUrlDesktop = "https://www.googleapis.com/pagespeedonline/v4/runPagespeed?url=" + Url + "&strategy=desktop&key=" + key; |
This file contains hidden or 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 | |
| * lodash 3.9.3 (Custom Build) <https://lodash.com/> | |
| * Build: `lodash modern -o ./lodash.js` | |
| * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/> | |
| * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE> | |
| * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors | |
| * Available under MIT license <https://lodash.com/license> | |
| */ | |
| ;(function() { |
This file contains hidden or 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
| /** | |
| * Creates a menu entry in the Google Sheets UI when the document is opened. | |
| */ | |
| function onOpen(e) { | |
| SpreadsheetApp.getUi().createAddonMenu() | |
| .addItem('Start', 'showSidebar') | |
| .addToUi(); | |
| } | |
| /** |
This file contains hidden or 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
| /** | |
| * Converts an XML string to a JSON object, using logic similar to the | |
| * sunset method Xml.parse(). | |
| * @param {string} xml The XML to parse. | |
| * @returns {Object} The parsed XML. | |
| */ | |
| function xmlToJson(xml) { | |
| var doc = XmlService.parse(xml); | |
| var result = {}; | |
| var root = doc.getRootElement(); |
Solution to https://twitter.com/nolanlawson/status/578948854411878400.
doSomething().then(function () {
This file contains hidden or 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 assignEditUrls() { | |
| var form = FormApp.openById('yourFormKey'); | |
| //enter form ID here | |
| var sheet = SpreadsheetApp.getActiveSpreadsheet().getSheetByName('yourWorksheetName'); | |
| //Change the sheet name as appropriate | |
| var data = sheet.getDataRange().getValues(); | |
| var urlCol = ; // column number where URL's should be populated; A = 1, B = 2 etc | |
| var responses = form.getResponses(); |
