Skip to content

Instantly share code, notes, and snippets.

@lukeupup
lukeupup / gist:7de402e820b6fb0666bfe62a4a675847
Created July 15, 2025 07:57
search() not working as expected
name: search() not working as expected
description: Creates a new snippet from a blank template.
host: WORD
api_set: {}
script:
content: >
document.getElementById("run").addEventListener("click", () =>
tryCatch(run));
@lukeupup
lukeupup / gist:6c6bc2b9c88135f70d78588f30476c47
Last active May 28, 2025 02:40
office-js bug report: binding event not working
name: Content control is unbound unexpectedly
description: Creates a new snippet from a blank template.
host: WORD
api_set: {}
script:
content: >
document.getElementById("run").addEventListener("click", () =>
tryCatch(run));
name: Slow clean up demo
description: Creates a new snippet from a blank template.
host: WORD
api_set: {}
script:
content: >
document.getElementById("run").addEventListener("click", () =>
tryCatch(run));
env:
browser: true
extends: 'eslint:recommended'
rules:
indent:
- error
- 2
- { "SwitchCase": 1, "VariableDeclarator": { "var": 2, "let": 2, "const": 3 }}
linebreak-style:
- error
@lukeupup
lukeupup / sort_strings.js
Last active November 18, 2016 07:30
One neat expression to sort string array in JavaScript
var strArr = ['ab', 'bc', '12', 'ac'];
strArr.sort(function (a, b) {
// You used to write code like:
//
// if (a > b) { return 1; }
// else if (a < b) { return -1; }
// else { return 0; }
//
// But in fact, you just need do this!