var emailAddressRE = regexp.MustCompile(`^(?i)(?:(?:\"[^\"]+\")|[a-z0-9!#$%&'*+\-\/=?^_` + "`" + `{|}~]+(?:\.[a-z0-9!#$%&'*+\-\/=?^_` + "`" + `{|}~]+)*)@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$`)
if !emailAddressRE.MatchString("emmaly@example.com") {
panic("oops")
}
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 Convert-ACLToCustomObject { | |
param ([Parameter(Mandatory = $true)]$ACL) | |
# Define a custom type | |
class CustomADObject { | |
[object]$ADObject | |
[string]$Guid | |
CustomADObject([object]$ADObject, [string]$Guid) { | |
$this.ADObject = $ADObject |
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
/** @OnlyCurrentDoc */ | |
/** | |
* Fixes the dropdown pickers on the Elections sheet if they need it. | |
*/ | |
function fixPickers() { | |
const spreadsheet = SpreadsheetApp.getActiveSpreadsheet(); | |
const sheet = (spreadsheet.getSheets().filter((sheet) => sheet.getSheetId() === 123123) || []).shift(); | |
const pickListsSheet = (spreadsheet.getSheets().filter((sheet) => sheet.getSheetId() === 234234) || []).shift(); | |
const pickers = spreadsheet.getRangeByName("ProductPickers"); |
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
/** @OnlyCurrentDoc */ | |
/** | |
* @param {any} value - value to test | |
* @returns {boolean} - `true` if a number, `false` otherwise | |
*/ | |
function isNumber(value) { | |
return typeof value == 'number' && isFinite(value); | |
} |
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
/** | |
* Retrieves a value from the cache if it's still valid. | |
* @param {string} key - The key for the cached data. | |
* @param {number} expirationInMinutes - The time after which data should be considered stale. | |
* @returns {any} - The cached data, or null if it's stale or not present. | |
*/ | |
function getCachedValue(key, expirationInMinutes) { | |
Logger.log("getCachedValue(%s, %s)", key, expirationInMinutes.toFixed(0)); | |
var cache = PropertiesService.getScriptProperties(); |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<title>Glowy Floaty Balls</title> | |
<style> | |
body { | |
background-color: #222; |
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
{ | |
"meta": { | |
"id": "f803c041-7f48-48d0-852c-22adff386327", | |
"icon": { | |
"url": null, | |
"type": "URL" | |
}, | |
"description": "Converts Key/Value list to JSON", | |
"name": "KV to JSON" | |
}, |
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
None: | |
- none | |
True: | |
- boolean | |
False: | |
- boolean | |
65535: | |
- number | |
- integer | |
123: |
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
/** | |
* @OnlyCurrentDoc | |
*/ | |
/** | |
* @param {SpreadsheetApp.Spreadsheet} spreadsheet | |
* @param {number} sheetId | |
* @returns SpreadsheetApp.Sheet | |
*/ | |
function getSheetById( |
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
use_bpm 60 | |
use_synth :kalimba | |
define :calm_section do | |
play_pattern_timed [:c4, :e4, :g4, :c5], [0.5, 0.5, 0.5, 1] | |
play_pattern_timed [:c4, :e4, :g4, :b4], [0.5, 0.5, 0.5, 1] | |
play_pattern_timed [:c4, :d4, :g4, :a4], [0.5, 0.5, 0.5, 1] | |
play_pattern_timed [:c4, :d4, :g4, :g4], [0.5, 0.5, 0.5, 1] | |
end |
NewerOlder