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
<Javascript name='JS-ShredJSON' timeLimit='200' > | |
<Properties> | |
<Property name='output-prefix'>private</Property> | |
<Property name='source'>ContextVariableContainingJSON</Property> | |
</Properties> | |
<ResourceURL>jsc://extractJsonToContextVars.js</ResourceURL> | |
</Javascript> |
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
// getTokenWithServiceAccount.js | |
// ------------------------------------------------------------------ | |
// uses only builtin modules, no external dependencies. | |
/* jshint esversion:9, node:true, strict:implied */ | |
/* global process, console, Buffer */ | |
const crypto = require('crypto'), | |
util = require('util'), |
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
// invokeCallsWithLimit.js | |
// ------------------------------------------------------------------ | |
// | |
/* jshint esversion:6, node:false, strict:implied */ | |
/* global properties, httpClient, context, Request */ | |
// Specify the limit of concurrent outbound requests | |
const ASYNC_LIMIT = 3; |
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
/* tweak-expiry-display.js */ | |
/* jshint esversion:9, browser:true, strict:implied */ | |
/* global window, navigator, console, fetch, Buffer */ | |
/* | |
Instructions | |
Add this as a "custom script" in the "Settings" dialog for the portal. | |
Be sure to bracket this source with open-and-close script tags. |
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
(First create a service account and create+download a keyfile for it) | |
KEY_FILE=~/Downloads/name-of-the-downloaded-keyfile.json | |
(download and install gcloud if you don't have it) | |
gcloud components update | |
gcloud auth list |
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
// weightedRandomSelector.js | |
// | |
// simple weighted random selector. | |
// | |
// Copyright © 2013, 2014 Dino Chiesa and Apigee Corp | |
// All rights reserved. | |
// | |
// created: Fri, 26 Jul 2013 11:14 | |
// last saved: <2019-June-24 06:13:20> | |
// |
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
// updateSheets.js | |
// ------------------------------------------------------------------ | |
// | |
// created: Tue Jan 14 05:22:42 2020 | |
// last saved: <2020-January-14 06:34:31> | |
const fs = require('fs'), | |
path = require('path'), | |
util = require('util'), | |
{google} = require('googleapis'), |
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
// base64.js | |
// ------------------------------------------------------------------ | |
// | |
// Bas64 encoder and decoder | |
// | |
// created: Sat Feb 20 12:30:51 2016 | |
// last saved: <2016-May-19 11:48:04> | |
(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
const app = require('express')(), | |
bodyParser = require('body-parser'), | |
yes = require('yes-https'); // HSTS => https always | |
var gStatus = { | |
version : '20180619-1845' | |
}; | |
// HSTS on only if process.env.NODE_ENV == 'production' | |
app.use(yes()); |