Skip to content

Instantly share code, notes, and snippets.

@CJOWood
CJOWood / modified-doorbell-notification.yaml
Last active December 2, 2023 05:05
Modified reolink doorbell notification on visitor press blueprint
blueprint:
name: Send a camera snapshot when doorbell was activated (CUSTOM)
description: 'This automation blueprint creates a camera snapshot when the doorbell was activated and
sends a notification to your phone with the picture.
'
domain: automation
input:
binary_sensor:
name: Push button
description:
blueprint:
name: Zooz ZEN72
description: Automations helper for the Zooz ZEN72 Dimmer Switch using the
Zwave JS integration.
domain: automation
input:
zooz_zen72:
name: Zooz ZEN72
description: The ZEN72 Switch to interact with.
selector:
function myFunction() {
var doc = DocumentApp.getActiveDocument();
var selection = doc.getSelection();
var rangeElems = selection.getRangeElements(); //Get main Elements of selection
rangeElems.forEach(function(elem){ //Let's rn through each to find ALL of their children.
var elem = elem.getElement(); //We have an ElementType. Let's get the full element.
getNestedTextElements(elem, elem.getType()); //Time to go down the rabbit hole.
});
}
function selectionHasWhichtypeChains() {
var doc = DocumentApp.getActiveDocument();
var selection = doc.getSelection();
var rangeElems = selection.getRangeElements();
rangeElems.forEach(function(elem){
var elem = elem.getElement();
elemsHaveWhatChildElems(elem, elem.getType());
function selectionHasWhichTypes() {
var doc = DocumentApp.getActiveDocument();
var selection = doc.getSelection();
var rangeElems = selection.getRangeElements();
rangeElems.forEach(function(elem){
var elem = elem.getElement();
elemsHaveWhatChildElems(elem, elem.getType());
function selectionHasWhichTypes() {
var doc = DocumentApp.getActiveDocument();
var selection = doc.getSelection();
var rangeElems = selection.getRangeElements();
rangeElems.forEach(function(elem){
var elem = elem.getElement();
Logger.log(elem.getType());
});
@CJOWood
CJOWood / Code.gs
Last active February 24, 2018 01:09
App Script Spreadsheet to Single Document 'MailMerge' using DocumentApp's different append functions
var TEMPLATE_ID = "Document_ID";
function createCerts(){
createOneDocumentFromTemplate(
[
['John', 'Doe'], ['Jane', 'Doe'], ['Jack', 'Turner'], ['Jordan', 'Bell'],['Lacy', 'Kim']
],
["<<First>>","<<Last>>"]);
}
@CJOWood
CJOWood / Code.gs
Created February 18, 2018 04:52
Using withSuccessHandler to Return Array and Make List
function onOpen() {
FormApp.getUi() // Or DocumentApp or FormApp.
.createMenu('Custom Menu')
.addItem('Show sidebar', 'showSidebar')
.addToUi();
}
function showSidebar() {
Logger.log("Showing Sidebar...");
var html = HtmlService.createHtmlOutputFromFile('test')
@CJOWood
CJOWood / Code.gs
Created February 18, 2018 03:59
Using withSuccessHandler to Return Data
function onOpen() {
FormApp.getUi() // Or DocumentApp or FormApp.
.createMenu('Custom Menu')
.addItem('Show sidebar', 'showSidebar')
.addToUi();
}
function showSidebar() {
var html = HtmlService.createHtmlOutputFromFile('Sidebar')
.setTitle('My custom sidebar')

Keybase proof

I hereby claim:

  • I am cjowood on github.
  • I am chriswood (https://keybase.io/chriswood) on keybase.
  • I have a public key ASAP79ox1-fkWSwO8RZ-IWMzOuQfv7AVlsi_gnvxK19OOAo

To claim this, I am signing this object: