This will require Google Workspace Admin SDK API admin
/AdminDirectory
/directory_v1
service enabled. See appsscript.json
.
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
; Chat.ahk v1.1 2021-10-17 emmaly | |
SetTitleMatchMode, RegEx | |
if WinExist("^(.* +- +)?Chat$ ahk_exe chrome.exe") | |
{ | |
WinActivate | |
} else { | |
Run, "C:\Program Files\Google\Chrome\Application\chrome_proxy.exe" --profile-directory="Profile 1" --app-id=mdpkiolbdkhdjpekfbkbmhigcaggjagi, "C:\Program Files\Google\Chrome\Application" | |
} |
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
; Meet.ahk v1.2 2021-11-20 emmaly | |
SetTitleMatchMode, RegEx | |
if WinExist("^(Google Meet|(Google Meet - )?Meet - [a-z]{3}-[a-z]{4}-[a-z]{3})$ ahk_exe chrome.exe") | |
{ | |
WinActivate | |
} else { | |
Run, "C:\Program Files\Google\Chrome\Application\chrome_proxy.exe" --profile-directory="Profile 1" --app-id=kjgfgldnnfoeklkmfkjfagphfepbbdan, "C:\Program Files\Google\Chrome\Application" | |
} |
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 DEBUG = false; | |
function onEdit(e) { | |
ScriptProperties.setProperties({ | |
"dirty": "true", | |
"lastHumanEdit": (new Date()).toJSON(), | |
}); | |
} | |
function janitor() { |
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
let data = {}; | |
const setter = (o, p, v) => { | |
if (typeof p === "string") { | |
return setter(o, p.split(/\s*:\s*/), v); | |
} | |
if (p.length === 1) { | |
o[p[0]] = v; | |
return o; | |
} |
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 onEdit(e) { | |
const range = e.range; | |
const sheet = range.getSheet(); | |
if (sheet.getSheetId() == 123123123) { // whatever sheet ID | |
for (let i=0; i<range.getNumRows(); i++) | |
rowOnEdit(sheet.getRange(range.getRow()+i, 1, 1, sheet.getLastColumn())); | |
} | |
} | |
function rowOnEdit(rowRange) { |
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 buildArrayProcessorChain (rawArrayProcessors) { | |
const arrayProcessors = (typeof rawArrayProcessors !== "object" ? [] : | |
Array.isArray(rawArrayProcessors) ? rawArrayProcessors : [rawArrayProcessors]) | |
.filter(v => (v.map === undefined && typeof v.filter === "function") || (v.filter === undefined && typeof v.map === "function")); | |
if (arrayProcessors.length === 0) return (a) => a; // nothing to do | |
return arrayProcessors.reduceRight((p, c) => { | |
// filter | |
if (typeof c.filter === "function") return (a) => typeof p !== "function" ? Array.prototype.filter.call(a, c.filter) : p(Array.prototype.filter.call(a, c.filter)); |
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
<# NextDNS install as DNS-over-DOH #> | |
param ( | |
[Parameter( | |
Mandatory = $true, | |
ParameterSetName = "NextDnsId", | |
ValueFromPipeline = $true, | |
ValueFromPipelineByPropertyName = $true, | |
HelpMessage = "NextDNS Configuration ID, like: 12ab3c" | |
)] |
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
// JSDoc for Google Apps Script doGet/doPost | |
/** | |
* @param {object} e | |
* @param {string|null} e.queryString - The value of the query string portion of the URL, or `null` if no query string is specified | |
* @param {Object.<string,string>} e.parameter - An object of key/value pairs that correspond to the request parameters. Only the first value is returned for parameters that have multiple values. | |
* @param {Object.<string,string[]>} e.parameters - An object similar to `e.parameter`, but with an array of values for each key | |
* @param {number} e.contentLength - The length of the request body for POST requests, or -1 for GET requests | |
* @param {object} e.postData - An object constructed from the POST body of POST requests, or `null` for GET requests | |
* @param {number} e.postData.length - The same as `e.contentLength` |