Skip to content

Instantly share code, notes, and snippets.

Avatar

Kanshi TANAIKE tanaikech

View GitHub Profile
@tanaikech
tanaikech / submit.md
Created Aug 10, 2022
Report: Challenging Exporting Selected Cells on Spreadsheet as Image using Google Apps Script and Javascript
View submit.md

Report: Challenging Exporting Selected Cells on Spreadsheet as Image using Google Apps Script and Javascript

Overview:

This is a report for challenging exporting the selected cells on Spreadsheet as an image using Google Apps Script and Javascript.

Description:

@tanaikech
tanaikech / submit.md
Created Aug 20, 2018
Replacing Text to Image for Google Document using Google Apps Script
View submit.md

Replacing Text to Image for Google Document using Google Apps Script

This is a sample script for replacing text to image for Google Document using Google Apps Script (GAS). There is a method for replacing text to text at Class Text of DocumentApp. But there are not methods for replacing text to image. So I created this sample script.

Demo :

This sample image was created by k3-studio.

Usage :

@tanaikech
tanaikech / submit.md
Created Apr 22, 2022
Simply Converting HTML to Plain Text using Google Apps Script
View submit.md

Simply Converting HTML to Plain Text using Google Apps Script

This is a sample script for simply converting HTML to plain text using Google Apps Script.

Sample values

HTML (input value)

sample text1
@tanaikech
tanaikech / submit.md
Last active Aug 8, 2022
Benchmark: Process cost for HTML Template using Google Apps Script
View submit.md

Benchmark: Process cost for HTML Template using Google Apps Script

Introduction

When we use HTML in the Google Apps Script project, in order to show the values from the Google Apps Script side, the HTML template is used. When I used the HTML template with a large value, I understood that the process cost can be reduced by devising a script. In this report, I would like to introduce the process cost of the HTML template using the benchmark.

As the result, it was clearly found that when an HTML table is created with Google Apps Script and shows the HTML table with the HTML template, the process cost becomes low. And also, it was found that in order to reduce the process cost for using the HTML template, it is required to prepare the HTML data with the Google Apps Script side.

Experimental procedure

@tanaikech
tanaikech / submit.md
Last active Aug 8, 2022
Sample Script for Resumable Upload to Google Drive using Axios with Node.js
View submit.md

Sample Script for Resumable Upload to Google Drive using Axios with Node.js

This is a sample script for the resumable upload using Axios with Node.js.

Sample script

In this sample script, as a sample situation in order to explain the resumable upload, the file data is loaded from the local PC, and the data is uploaded to Google Drive with the resumable upload.

const axios = require("axios");
@tanaikech
tanaikech / submit.md
Created Aug 8, 2022
Clearing Discrete Cell Values on Multiple Sheets using Google Apps Script
View submit.md

Clearing Discrete Cell Values on Multiple Sheets using Google Apps Script

This is a sample script for clearing the discrete cell values on multiple sheets using Google Apps Script.

There might be a case where you want to clear the values of the discrete cells in the multiple sheets using Google Apps Script. In this post, I would like to introduce the efficient script for achieving this.

Sample script 1

Please copy and paste the following script to the script editor of the Google Spreadsheet you want to use.

@tanaikech
tanaikech / submit.md
Last active Aug 7, 2022
Report: Documentation Comments including JsDoc for Functions of Google Apps Script
View submit.md

Report: Documentation Comments including JsDoc for Functions of Google Apps Script

This is a report for the documentation comments for the functions of Google Apps Script.

When the documentation comments for functions of Google Apps Script are considered, you will think JsDoc. At Google Apps Script, a part of JsDoc can be used. But, in this report, I would like to introduce the documentation comments including JsDoc.

Sample situations

Sample 1

@tanaikech
tanaikech / submit.md
Last active Aug 5, 2022
Uploading Files to OneDrive Using Node.js
View submit.md

Upload contents for an item on OneDrive

In order to use this script, please retrieve client id, client secret and refresh token before. About this, you can see the detail information at https://gist.github.com/tanaikech/d9674f0ead7e3320c5e3184f5d1b05cc.

1. Simple item upload

This is for the simple item upload is available for items with less than 4 MB of content. The detail information is https://dev.onedrive.com/items/upload_put.htm.

var fs = require('fs');
var mime = require('mime');
var request = require('request');
@tanaikech
tanaikech / submit.md
Last active Aug 3, 2022
Downloading Shared Files on Google Drive Using Curl
View submit.md

Downloading Shared Files on Google Drive Using Curl

When the shared files on Google Drive is downloaded, it is necessary to change the download method by the file size. The boundary of file size when the method is changed is about 40MB.

File size < 40MB

CURL

filename="### filename ###"
fileid="### file ID ###"
curl -L -o ${filename} "https://drive.google.com/uc?export=download&amp;id=${fileid}"
@tanaikech
tanaikech / submit.md
Created May 22, 2019
Possibility of Real Time Processes In a Cell on Spreadsheet using Google Apps Script
View submit.md

Possibility of Real Time Processes In a Cell on Spreadsheet using Google Apps Script

This is a sample script for investigating the possibility of the real time processes in a cell on Google Spreadsheet using Google Apps Script. As a sample situation, it tried the real time clock in a cell on Google Spreadsheet using Google Apps Script.

Demo:

Usage: