Skip to content

Instantly share code, notes, and snippets.

View Strusovsky's full-sized avatar

Andrew Strusovsky Strusovsky

View GitHub Profile
@Strusovsky
Strusovsky / Cross-join-Google-Sheets2.1.sheets
Created October 6, 2019 08:53 — forked from Max-Makhrov/Cross-join-Google-Sheets2.1.sheets
Formulas for Cartessian cross-join in Google Sheets
=ArrayFormula(
VLOOKUP(
CEILING(ROW(OFFSET(INDIRECT("A1"),,,COUNTA(A2:A)*COUNTA(B2:B)))/COUNTA(B2:B)) ,
{ROW(A2:A)-row(A1),A2:A} , 2, )
)
/**
* Moves row of data to another spreadsheet based on criteria in column 6 to sheet with same name as the value in column 4.
*/
function onEdit(e) {
// see Sheet event objects docs
// https://developers.google.com/apps-script/guides/triggers/events#google_sheets_events
var ss = e.source;
var s = ss.getActiveSheet();
var r = e.range;
@Strusovsky
Strusovsky / submit.md
Created October 6, 2019 08:22 — forked from tanaikech/submit.md
Downloading Files From Google Drive Under No Authorization Using Browser

Downloading Files From Google Drive Under No Authorization Using Browser

This is a sample script for downloading files from Google Drive under no authorization using browser. By using this sample, you can make other users download files from your Google Drive. Even if the other users are not Google users, they can download the files.

Demo

@Strusovsky
Strusovsky / submit.md
Created October 6, 2019 08:05 — forked from tanaikech/submit.md
Uploading Local Files to Google Drive without Authorization using HTML Form

Uploading Local Files to Google Drive without Authorization using HTML Form

This is a sample script for uploading local file to Google Drive without the authorization using HTML form. A selected file in your local PC using HTML form is uploaded to Google Drive and saved to Google Drive.

When you use this, at first, please deploy Web Apps. The script is doPost() of following scripts.

Script : Google Apps Script

function doPost(e) {
 var data = Utilities.base64Decode(e.parameters.data);
@Strusovsky
Strusovsky / submit.md
Created October 6, 2019 08:04 — forked from tanaikech/submit.md
Downloading File Using Button of Dialog Box on Google Docs

Downloading File Using Button of Dialog Box on Google Docs

This is a sample script for downloading a file using a button of dialog box on Google Docs (Spreadsheet, Document and Slides).

Please use this sample script at script editor on Google Docs (Spreadsheet, Document and Slides). And please set file ID in the script.

FLow :

The flow of this sample script is as follows.

  1. Run dialog().
  • Open a dialog.
@Strusovsky
Strusovsky / submit.md
Created October 6, 2019 08:00 — forked from rudimusmaximus/submit.md
Benchmark: Loop for Array Processing using Google Apps Script

Benchmark: Loop for Array Processing using Google Apps Script

April 16, 2018

Kanshi Tanaike

Introduction

@Strusovsky
Strusovsky / .ru.md
Created October 6, 2019 07:37 — forked from oshliaer/.ru.md
ModalMessage

ModalMessage

Unsplash

Простой объект для генерации модальных окон взамен Browser.msgBox

Пример Меню - To Do

How to concatenate ranges in Google spreadsheets

Unsplash

Sometimes it is necessary to concat ranges in Google Spreadsheet. Eg, Data 1 and Data 2

Sheet Data 1

Name Date Sum
Ethan 3/4/2017 31
function onEdit(event)
{
var maxRows = false;
// Change Settings:
//--------------------------------------------------------------------------------------
var TargetSheet = 'Main'; // name of sheet with data validation
var LogSheet = 'Data1'; // name of sheet with data
var NumOfLevels = 4; // number of levels of data validation
var lcol = 2; // number of column where validation starts; A = 1, B = 2, etc.
@Strusovsky
Strusovsky / metadesc.py
Created June 24, 2019 01:30 — forked from pshapiro/metadesc.py
Use Text Summarization Algorithms to Help Aid the Writing of Meta Descriptions
import csv
import os
from sumy.parsers.html import HtmlParser
from sumy.parsers.plaintext import PlaintextParser
from sumy.nlp.tokenizers import Tokenizer
from sumy.summarizers.lsa import LsaSummarizer as Lsa
from sumy.summarizers.luhn import LuhnSummarizer as Luhn
from sumy.summarizers.text_rank import TextRankSummarizer as TxtRank
from sumy.summarizers.lex_rank import LexRankSummarizer as LexRank
from sumy.summarizers.sum_basic import SumBasicSummarizer as SumBasic