Skip to content

Instantly share code, notes, and snippets.

/**
* Формат телефона из
* +7(999) 888-77-66
* в
* 89998887766
*/
function get_NU_PhoneNumber(range) {
let value = Array.isArray(range) ? range.flat() : [range]
return value.map(v => [v.replace("+7", "8").replace(/\D/g, "")])
}
@volond1975
volond1975 / parseHeaderNames.js
Created May 26, 2021 06:35
parseHeaderNames #gas #js
function parseHeaderNames({headerNames=[],delimetr='!'}={}){
var headerNamesArr=headerNames.map(h=>h.split(delimetr))
var headersObj=fromEntries(headerNamesArr)
return {headerNamesArr,headersObj}
}
@volond1975
volond1975 / appsScript_ListFilesFolders_ver.2.js
Created January 7, 2021 01:34 — forked from mesgarpour/appsScript_ListFilesFolders_ver.2.js
[Google Apps Script] List all files & folders in a Google Drive folder, & write into a speadsheet
/*
* Copyright 2017 Mohsen Mesgarpour
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@volond1975
volond1975 / getLastRowColumn.txt
Last active April 12, 2022 06:42
|-|{"files":{"namespase.js":{"env":"plain"},"birthday.txt":{"env":"plain"},"getLastRowColumn.txt":{"env":"plain"}},"tag":"Uncategorized"}
function getLastRow(data, column) {
var max = data.length;
var x = data.length
for (x in data) {
if (data[x][column - 1]) {
max = x * 1 + 1;
};
max -= max;
}
function doGet() {
return HtmlService.createHtmlOutputFromFile('Index')
.setSandboxMode(HtmlService.SandboxMode.IFRAME);
}
function doSomething() {
Logger.log('I was called!');
}
function testIKB(){
var id='1vaRqCJNhLQs5BeaZWU652BbUsHNM_ksQhawu5KFJZSk';
if (id!== undefined){
var ss=SpreadsheetApp.openById(id);
}
else{
var ss=ss||SpreadsheetApp.getActiveSpreadsheet();
}
var signature=signature||'InlineKeyboard'
@volond1975
volond1975 / Untitled-1.js
Created October 22, 2018 14:02
inlinkeyboard
function testIKB(){
var id='1vaRqCJNhLQs5BeaZWU652BbUsHNM_ksQhawu5KFJZSk';
if (id!== undefined){
var ss=SpreadsheetApp.openById(id);
}
else{
var ss=ss||SpreadsheetApp.getActiveSpreadsheet();
}
var signature=signature||'InlineKeyboard'
@volond1975
volond1975 / init_by_gas_hub.html
Created October 11, 2018 05:52
getSheetByGit
init by gas-hub, just delete this file.
@volond1975
volond1975 / RegExp.gs
Last active January 14, 2025 18:01
RegExpTest|-|{"files":{"RegExp.gs":{"env":"js"}},"tag":"Uncategorized"}
// This function gets its input arguments from a spreadsheet cells
// It uses these arguments to create a RegExp using the
// RegExp constructor function.
/**
* @param {} searchString Строка в которой ищем совпадения с паттерном
* @param {} pattern Паттерн
* @param {} modifiers Флаги i,m,g
* @customfunction
*/
function RegExpTest(searchString, pattern, modifiers) {
@volond1975
volond1975 / kub.js
Created September 1, 2018 08:15
kub2
//
// AlaSQL node.js sample
//
//var data=[];
//var data=fs.readFileSync('table.json');
var filenamekub="csv/kub.csv";
var filenameGrpD="csv/grpD.csv";
//https://docs.google.com/spreadsheets/d/{key}/gviz/tq?tqx=out:csv&sheet={sheet_name}