Skip to content

Instantly share code, notes, and snippets.

View akrantz's full-sized avatar

Adam Krantz akrantz

View GitHub Profile
@akrantz
akrantz / Daedalus.yaml
Last active January 26, 2018 01:55
Shared with Script Lab
name: Daedalus
description: ''
author: akrantz
host: EXCEL
api_set: {}
script:
content: |
$("#run").click(() => tryCatch(main));
const BatchFunction = function (workbook: Excel.Workbook): Promise<any> { return Promise.resolve() };
name: cancelable function
description: ''
host: EXCEL
api_set: {}
script:
content: |-
/**
* An example of a cancelable function
* @customfunction
*/
name: functions - return type (implicit)
description: ''
host: EXCEL
api_set: {}
script:
content: |
/**
* @customfunction
*/
function returnsBoolean() {
name: functions - return type (TypeScript)
description: ''
host: EXCEL
api_set: {}
script:
content: |
/**
* @customfunction
*/
function returnsBoolean(): boolean {
@akrantz
akrantz / test.md
Created May 2, 2019 04:35
Hello World Markdown

Hello World

This is content converted from Markdown!

Here's a JSON sample:

{
  "foo": "bar"
}
@akrantz
akrantz / test.html
Created May 2, 2019 04:35
Hello World HTML
<html>
<head>
<style>
h1 {
font-family: Calibri;
}
</style>
</head>
<body>
<h1>Hello World!</h1>
@akrantz
akrantz / Streaming function that returns a 2D array of numbers.EXCEL.yaml
Created May 20, 2019 21:50
A streaming function that continuously pushes incremental values into an array.
name: Streaming function that returns a 2D array of numbers
description: >-
A streaming function that continuously pushes incremental values into an
array.
host: EXCEL
api_set: {}
script:
content: >-
/**
* Increments a value once a second.
@akrantz
akrantz / underscore.EXCEL.yaml
Created May 24, 2019 18:29
Can custom function id contain an underscore?
name: underscore
description: Can custom function id contain an underscore?
host: EXCEL
api_set: {}
script:
content: |-
/**
* @customfunction
*/
function add_numbers(first: number, second: number): number {
@akrantz
akrantz / Repeating parameters.EXCEL.yaml
Created May 30, 2019 01:33
Sample functions that use repeating parameters.
name: Repeating parameters
description: Sample functions that use repeating parameters.
host: EXCEL
api_set: {}
script:
content: |
$("#run").click(() => tryCatch(run));
async function run() {
await Excel.run(async (context) => {
@akrantz
akrantz / Custom Function SUM().EXCEL.yaml
Last active April 25, 2022 08:02
Implement the SUM() function in JavaScript.
name: Custom Function SUM()
description: Implement the SUM() function in JavaScript.
host: EXCEL
api_set: {}
script:
content: |
/**
* The sum of all of the numbers.
* @customfunction
* @param number1 A number (such as 1 or 3.1415), a cell address (such as A1 or $E$11), or a range of cell addresses (such as B3:F12).