How to Fetch and Display API Data on Your Website

Fetching data from an API and displaying it on a webpage is a foundational skill for any web developer. In this blog post, we’ll guide you through a simple example of fetching data from a REST API and dynamically outputting it on your webpage using JavaScript. This example covers: Let’s dive into the implementation! The … Read more

How to Fetch and Display a Random Dog Image on Your Website

In this tutorial, we’ll walk through a simple yet fun project: building a webpage that fetches and displays a random dog image using the Dog CEO API. Whether you’re new to JavaScript or looking for a practical example of using the fetch() API to interact with a third-party service, this post has something for everyone. … Read more

London Ontario 2025 Summary of the Presentation: Unleashing the Power of Google Apps Script and Gemini

Meet me at https://gdg.community.dev/events/details/google-gdg-london-presents-google-devfest-2024-london-on-ca/ Devfest in London Jan 25, 11:00 AM – 3:00 PM (EST) Western University, 1151 Richmond St, London, N6A 3K7 This presentation by Laurence Svekis explores the integration of Google Apps Script and Gemini AI to streamline workflows, enhance automation, and unlock new possibilities in Google Workspace. It provides an overview of Apps Script as a … Read more

Test Your Skills – JavaScript Questions how many can you get correct

Functions What is a callback function? A) A function that is passed as an argument to another function.B) A function that returns another function.C) A function that is executed immediately after declaration.D) A function that calls itself. Answer: A) A function that is passed as an argument to another function. Explanation:A callback function is passed … Read more

Intermediate JavaScript Guide

1. Functions in JavaScript 1.1 Callbacks A callback function is a function passed into another function as an argument, to be executed at a later time or in response to an event. This is a fundamental concept in asynchronous JavaScript (e.g., handling responses from fetch calls, setTimeout, event listeners, etc.). <details> <summary>Example of a callback</summary> … Read more

Organizing Your Google Docs with Apps Script: A Guide to Sorting Sections by Headings

When working on large Google Docs, organizing content systematically can be daunting, especially if you’re dealing with sections categorized under specific headings. This is where Google Apps Script comes to the rescue! In this blog post, we’ll explore a function, reorganizeDocByHeading2, that reorganizes the content of a Google Doc based on predefined categories under “Heading … Read more

Apps Script that counts the number of Heading 4 elements in a Google Doc

Apps Script Code function countHeading4InDocument() { const DOCID = ‘YOUR_DOCUMENT_ID_HERE’; // Replace with your Document ID const doc = DocumentApp.openById(DOCID); const body = doc.getBody(); const paragraphs = body.getParagraphs(); let heading4Count = 0; // Iterate through all paragraphs for (let i = 0; i < paragraphs.length; i++) { const paragraph = paragraphs[i]; if (paragraph.getHeading() === DocumentApp.ParagraphHeading.HEADING4) … Read more

Apps Script that adds a blank line above every occurrence of the word

Apps Script Code function addBlankLineAndBoldExplanation() { const DOCID = ‘YOUR_DOCUMENT_ID_HERE’; // Replace with your Document ID const doc = DocumentApp.openById(DOCID); const body = doc.getBody(); const paragraphs = body.getParagraphs(); // Iterate through all paragraphs in the document for (let i = 0; i < paragraphs.length; i++) { const paragraph = paragraphs[i]; const text = paragraph.getText().trim(); // … Read more

Apps Script code that adds a horizontal line above each Heading 4

Apps Script Code function addHorizontalLineAboveHeading4() { const DOCID = ‘YOUR_DOCUMENT_ID_HERE’; // Replace with your Document ID const doc = DocumentApp.openById(DOCID); const body = doc.getBody(); const paragraphs = body.getParagraphs(); // Iterate through the paragraphs in reverse order for (let i = paragraphs.length – 1; i >= 0; i–) { const paragraph = paragraphs[i]; // Check if … Read more

Automating Document Formatting: Convert and Update Heading 3 to Heading 2 in Google Docs

Organizing a Google Doc can often involve repetitive tasks like updating headings or restructuring content. One such common task is converting specific headings to a different style while modifying their text content. In this blog post, we’ll explore a handy Google Apps Script that automatically updates Heading 3 elements to Heading 2, transforms their text … Read more