Skip to content

Instantly share code, notes, and snippets.

Avatar
😋

Max Makhrov Max-Makhrov

😋
View GitHub Profile
@Max-Makhrov
Max-Makhrov / submit.md
Last active Oct 23, 2021
Upload image from your Computer to Google Drive using HTML-form. Show image via URL (IMAGE function) in your Spreadsheet
View submit.md

Upload image from your Computer to Google Drive using HTML-form. Show image via URL (IMAGE function) in your Spreadsheet

About the script

The sctipt was originally designed by Kanshi TANAIKE.

Please see the original script and instructions first.

Script : Google Apps Script

View Dynamic-Dependent-Drop-Down-Lists.js
// please refer here for more info:
// https://sheetswithmaxmakhrov.wordpress.com/2018/01/03/smart-data-validation-create-dependent-drop-down-lists-in-goole-sheets/
function onEdit(event)
{
var maxRows = false;
// Change Settings:
//--------------------------------------------------------------------------------------
var TargetSheet = 'Main'; // name of sheet with data validation
@Max-Makhrov
Max-Makhrov / telegrambot.gs
Last active Aug 12, 2021
Telegram Bot for Lazy
View telegrambot.gs
// __
// /_ |
// | |
// | |
// | |
// |_|
// Set Bot, copy token:
// https://t.me/botfather
// set your token ↓
var token = "1815465433:AAGpRcd--KsZycuSYmBOCDcVvws5lSvkuqw";
@Max-Makhrov
Max-Makhrov / gist:5a36610a2dd1eaff3d3252d74e34d557
Last active Aug 10, 2021 — forked from peterherrmann/gist:2700284
GASRetry - Exponential backoff JavaScript implementation for Google Apps Script (Library project key: "MGJu3PS2ZYnANtJ9kyn2vnlLDhaBgl_dE")
View gist:5a36610a2dd1eaff3d3252d74e34d557
/**
* Invokes a function, performing up to 5 retries with exponential backoff.
* Retries with delays of approximately 1, 2, 4, 8 then 16 seconds for a total of
* about 32 seconds before it gives up and rethrows the last error.
* See: https://developers.google.com/google-apps/documents-list/#implementing_exponential_backoff
* <br>Author: peter.herrmann@gmail.com (Peter Herrmann)
<h3>Examples:</h3>
<pre>//Calls an anonymous function that concatenates a greeting with the current Apps user's email
var example1 = GASRetry.call(function(){return "Hello, " + Session.getActiveUser().getEmail();});
</pre><pre>//Calls an existing function
@Max-Makhrov
Max-Makhrov / googleFormOnSubmit.gs
Created Jun 10, 2021
Google Forms Script. Sample script on form submit. Get responses.
View googleFormOnSubmit.gs
// gentleman script for google forms
//
// gets submitted valus:
// 1. question label
// 2. question id
// 3. response value
//
// ⚠️ This is Form trigger.
// Open script editor from form interface
// Install it wia Triggers
@Max-Makhrov
Max-Makhrov / combine.gs
Last active Jun 9, 2021
Combine data from multiple sheets to 1
View combine.gs
// combine data from all sheets in current file
function combineData() {
// CHANGE SHEET NAME ↓ /////////////////////////////
var sheetTo = 'combined';
////////////////////////////////////////////////////
var file = SpreadsheetApp.getActiveSpreadsheet();
var sheets = file.getSheets(); // get all the sheets
// set where we want to write the results
var outSheet = file.getSheetByName(sheetTo);
var outdata = [], sheet, sName, data = [];
@Max-Makhrov
Max-Makhrov / Dependent DropDowns 2D Wide. v0.gs
Last active May 27, 2021
2D Dependent Dropdowns for Google Sheets. ~70 lines of code. Classy sample
View Dependent DropDowns 2D Wide. v0.gs
// Copy sample file here:
// https://docs.google.com/spreadsheets/d/1hUOuDZcfXxaLvJbEA-SxzF4oGGU3lW3iJyS4wAV8YWA/copy
function onEdit(e) {
dvl0_(e);
}
function dvl0_sets_() {
return [
{
@Max-Makhrov
Max-Makhrov / Code.gs
Created May 19, 2021
Google Script. HTML-form to select image from computer and save it to Google Drive and to Sheet cell as image.
View Code.gs
// sample file:
// https://docs.google.com/spreadsheets/d/1_rk4xFsMrxiuXqo5-HQWfvOjBU6nGDw1rlJFU0sci9U/copy
function onOpen() {
var ui = SpreadsheetApp.getUi();
// Or DocumentApp or FormApp.
ui.createMenu('🙂 Click me')
.addItem('Image 🖼️ to Drive', 'showFormImages')
.addToUi();
}
View parsUrls.gs
function test_parse() {
var file = SpreadsheetApp.getActive();
var sheet = file.getSheetByName('Sheet1'); // change
var sets = {
rangeParse: sheet.getRange('L2:L16429'), // change
rangeResult: sheet.getRange("M2"), // change
func_parse: parseOkkoFilmToGetHorizontalPoster_ // change / create your function
};
parseUrls_(sets);
}
@Max-Makhrov
Max-Makhrov / Cross-join-Google-Sheets2.1.sheets
Last active May 5, 2021
Formulas for Cartessian cross-join in Google Sheets
View Cross-join-Google-Sheets2.1.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, )
)