Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am heholek on github.
* I am hehol (https://keybase.io/hehol) on keybase.
* I have a public key ASCCGMHiL6YpPoh-nxzRAoiAwYsMM5F6pYXtv46Gt-VVGAo
To claim this, I am signing this object:
@heholek
heholek / gist:3a2bb393e05478ef4635c0ec869e6ae6
Created August 10, 2020 18:27 — forked from mhawksey/gist:1442370
Google Apps Script to read JSON and write to sheet
function getJSON(aUrl,sheetname) {
//var sheetname = "test";
//var aUrl = "http://pipes.yahoo.com/pipes/pipe.run?_id=286bbb1d8d30f65b54173b3b752fa4d9&_render=json";
var response = UrlFetchApp.fetch(aUrl); // get feed
var dataAll = JSON.parse(response.getContentText()); //
var data = dataAll.value.items;
for (i in data){
data[i].pubDate = new Date(data[i].pubDate);
data[i].start = data[i].pubDate;
}
@heholek
heholek / google-sheets-to-firebase.gs
Created August 10, 2020 18:26 — forked from schlosser/google-sheets-to-firebase.gs
Copy your Google Sheets spreadsheet to Firebase using this AppScript.
// Installation & Setup
// 1. Create a spreadsheet.
// 2. Under Tools > Script Editor, paste this script
// 3. Under Resources > Libraries, add two library dependencies:
// - OAuth2: 1B7FSrk5Zi6L1rSxxTDgDEUsPzlukDsi4KGuTMorsTQHhGBzBkMun4iDF
// - FirebaseApp: 1hguuh4Zx72XVC1Zldm_vTtcUUKUA6iBUOoGnJUWLfqDWx5WlOJHqYkrt
// 4. Create a Firebase project and initialize the Realtime Database
// 5. Fill in your project details in FIREBASE_IO_URL and SERVICE_ACCOUNT below.
// 6. Under Resources > Cloud Platform Project, add your Firebase project's project number from GCP. You
// can find your project number in the GCP Cloud Console here: https://console.cloud.google.com/home/dashboard?project=_
@heholek
heholek / submit.md
Created August 8, 2020 04:39 — forked from tanaikech/submit.md
Benchmark: Loop for Array Processing using Google Apps Script without V8

Benchmark: Loop for Array Processing using Google Apps Script without V8

April 16, 2018 Published.

July 26, 2018 Updated. Result of reduce was added.

@heholek
heholek / setup-zeromq.sh
Created August 2, 2020 21:59 — forked from katopz/setup-zeromq.sh
Setup zeromq in Ubuntu 16.04
#!/usr/bin/bash
# Download zeromq
# Ref http://zeromq.org/intro:get-the-software
wget https://github.com/zeromq/libzmq/releases/download/v4.2.2/zeromq-4.2.2.tar.gz
# Unpack tarball package
tar xvzf zeromq-4.2.2.tar.gz
# Install dependency
@heholek
heholek / README.md
Created June 29, 2020 02:37 — forked from marknca/README.md
Read multiple RSS feeds and write their entries as Hugo posts

Usage

List your feeds in a tab seperated value text file with the format;

Name of feed\tFEED_URL
Name of feed\tFEED_URL
Name of feed\tFEED_URL
@heholek
heholek / submit.md
Created June 27, 2020 20:49 — forked from tanaikech/submit.md
Managing Shared Drive using Drive Service of Google Apps Script

Managing Shared Drive using Drive Service of Google Apps Script

When the method of "Files: list" in Drive API v3, the official document of includeItemsFromAllDrives and supportsAllDrives says as follows.

Deprecated - Whether both My Drive and shared drive items should be included in results. This parameter will only be effective until June 1, 2020. Afterwards shared drive items are included in the results. (Default: false)

Deprecated - Whether the requesting application supports both My Drives and shared drives. This parameter will only be effective until June 1, 2020. Afterwards all applications are assumed to support shared drives. (Default: false)

From this situation, I thought that Drive service might be able to manage the shared Drive from June 1, 2020. So I tested this as follows. As the results, I could confirm that now, the shared Drive got to be able to be mana

@heholek
heholek / submit.md
Created June 27, 2020 20:49 — forked from tanaikech/submit.md
Disabling Buttons Put on Google Spreadsheet using Google Apps Script

Disabling Buttons Put on Google Spreadsheet using Google Apps Script

Description

This is a sample script for disabling the buttons put on Google Spreadsheet using Google Apps Script.

When a script is run by clicking a button on Google Spreadsheet, there is the case that you don't want to make users run the script in duplicate. This sample script achieves this situation.

Demo

@heholek
heholek / submit.md
Created June 27, 2020 20:48 — forked from tanaikech/submit.md
Retrieving Difference Between 2 Arrays using Google Apps Script

Retrieving Difference Between 2 Arrays using Google Apps Script

This is a sample script for retrieving the difference between 2 arrays, which are the old values and the new values, using Google Apps Script. In my environment, I sometimes have the situation that it is required to retrieve the difference between 2 arrays. So I prepared this as a sample script. I think that this can be also used at Javascript and Node.js. If this was also useful for your situation, I'm glad.

Sample script

In this sample script, the difference of the values of oldValues and newValues is retrieved as an object.

const getDiffFrom2Arrays = (oldValues, newValues) => {
@heholek
heholek / submit.md
Created June 27, 2020 20:48 — forked from tanaikech/submit.md
Search Dialog Sample using TextFinder with Google Apps Script

Search Dialog Sample using TextFinder with Google Apps Script

This is a sample script for the search dialog using TextFinder with Google Apps Script. If this sample script could help to indicate the possibility of TextFinder, I'm glad.

Demo

In this demonstration, the value of test is searched. When "NEXT" is clicked, the next searched value is activated. When "PREVIOUS" is clicked, the previous searched value is activated. The search can be done for all sheets in the Google Spreadsheet.